diff options
Diffstat (limited to 'test/rubygems/test_gem_source_git.rb')
-rw-r--r-- | test/rubygems/test_gem_source_git.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb index 026492ece0..58bff84490 100644 --- a/test/rubygems/test_gem_source_git.rb +++ b/test/rubygems/test_gem_source_git.rb @@ -27,6 +27,26 @@ class TestGemSourceGit < Gem::TestCase assert_path_exists File.join @source.install_dir, 'a.gemspec' end + def test_checkout_local + @source.remote = false + + @source.checkout + + install_dir = File.join Gem.dir, 'bundler', 'gems', "a-#{@head[0..11]}" + + refute_path_exists File.join install_dir, 'a.gemspec' + end + + def test_checkout_local_cached + @source.cache + + @source.remote = false + + @source.checkout + + assert_path_exists File.join @source.install_dir, 'a.gemspec' + end + def test_checkout_submodules source = Gem::Source::Git.new @name, @repository, 'master', true @@ -54,6 +74,14 @@ class TestGemSourceGit < Gem::TestCase end end + def test_cache_local + @source.remote = false + + @source.cache + + refute_path_exists @source.repo_cache_dir + end + def test_dir_shortref @source.cache @@ -99,6 +127,12 @@ class TestGemSourceGit < Gem::TestCase assert_equal expected, @source.install_dir end + def test_install_dir_local + @source.remote = false + + assert_nil @source.install_dir + end + def test_repo_cache_dir expected = File.join Gem.dir, 'cache', 'bundler', 'git', "a-#{@hash}" @@ -211,6 +245,15 @@ class TestGemSourceGit < Gem::TestCase assert_equal extension_dir, b_spec.extension_dir end + def test_specs_local + source = Gem::Source::Git.new @name, @repository, 'master', true + source.remote = false + + capture_io do + assert_empty source.specs + end + end + def test_uri_hash assert_equal @hash, @source.uri_hash |