diff options
author | scott Chacon <schacon@agadorsparticus.(none)> | 2007-11-10 12:43:33 -0800 |
---|---|---|
committer | scott Chacon <schacon@agadorsparticus.(none)> | 2007-11-10 12:43:33 -0800 |
commit | fde3263abc5c7866aa7dce7aef28eacaa33d7664 (patch) | |
tree | c9911ac92e9770c7bfea3e79269f8e7dcf7f6982 /tests/units/test_init.rb | |
parent | 9d59d2965184964ab6662282ef5f9ceac2c58552 (diff) | |
download | third_party-ruby-git-fde3263abc5c7866aa7dce7aef28eacaa33d7664.tar.gz third_party-ruby-git-fde3263abc5c7866aa7dce7aef28eacaa33d7664.tar.xz third_party-ruby-git-fde3263abc5c7866aa7dce7aef28eacaa33d7664.zip |
few hours work - diff is done
Diffstat (limited to 'tests/units/test_init.rb')
-rw-r--r-- | tests/units/test_init.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/units/test_init.rb b/tests/units/test_init.rb index 56d2a18..f1a8ba4 100644 --- a/tests/units/test_init.rb +++ b/tests/units/test_init.rb @@ -24,6 +24,37 @@ class TestInit < Test::Unit::TestCase g = Git.repo @wbare assert_equal(g.repo.path, @wbare) end + + #g = Git.init + # Git.init('project') + # Git.init('/home/schacon/proj', + # { :git_dir => '/opt/git/proj.git', + # :index_file => '/tmp/index'} ) + def test_git_init + in_temp_dir do |path| + Git.init + assert(File.directory?(File.join(path, '.git'))) + assert(File.exists?(File.join(path, '.git', 'config'))) + end + end + + def test_git_init_remote_git + in_temp_dir do |dir| + assert(!File.exists?(File.join(dir, 'config'))) + + in_temp_dir do |path| + Git.init(path, :repository => dir) + assert(File.exists?(File.join(dir, 'config'))) + end + end + end + + def test_git_clone + in_temp_dir do |path| + Git.clone(uri, :repository => dir) + assert(File.exists?(File.join(dir, 'config'))) + end + end # trying to open a git project using a bare repo - rather than using Git.repo def test_git_open_error |