3 require File.dirname(__FILE__) + '/../test_helper'
5 class TestInit < Test::Unit::TestCase
12 assert_equal(g.dir.path, @wdir)
13 assert_equal(g.repo.path, File.join(@wdir, '.git'))
14 assert_equal(g.index.path, File.join(@wdir, '.git', 'index'))
18 g = Git.open @wdir, :repository => @wbare, :index => @index
19 assert_equal(g.repo.path, @wbare)
20 assert_equal(g.index.path, @index)
25 assert_equal(g.repo.path, @wbare)
30 # Git.init('/home/schacon/proj',
31 # { :git_dir => '/opt/git/proj.git',
32 # :index_file => '/tmp/index'} )
36 assert(File.directory?(File.join(path, '.git')))
37 assert(File.exists?(File.join(path, '.git', 'config')))
41 def test_git_init_remote_git
43 assert(!File.exists?(File.join(dir, 'config')))
46 Git.init(path, :repository => dir)
47 assert(File.exists?(File.join(dir, 'config')))
54 Git.clone(uri, :repository => dir)
55 assert(File.exists?(File.join(dir, 'config')))
59 # trying to open a git project using a bare repo - rather than using Git.repo
60 def test_git_open_error
61 assert_raise ArgumentError do