diff options
Diffstat (limited to 'test/rubygems/test_gem_source_git.rb')
-rw-r--r-- | test/rubygems/test_gem_source_git.rb | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/test/rubygems/test_gem_source_git.rb b/test/rubygems/test_gem_source_git.rb index f1c5eb9b71..9cdcbc0ed5 100644 --- a/test/rubygems/test_gem_source_git.rb +++ b/test/rubygems/test_gem_source_git.rb @@ -78,12 +78,6 @@ class TestGemSourceGit < Gem::TestCase refute_equal @source, source end - def test_load_spec - spec = @source.load_spec @name - - assert_equal "#{@name}-#{@version}", spec.full_name - end - def test_install_dir @source.cache @@ -133,6 +127,38 @@ class TestGemSourceGit < Gem::TestCase assert_equal(-1, git. <=>(installed), 'git <=> installed') end + def test_specs + source = Gem::Source::Git.new @name, @repository, 'master', true + + Dir.chdir 'git/a' do + FileUtils.mkdir 'b' + + Dir.chdir 'b' do + b = Gem::Specification.new 'b', 1 + + open 'b.gemspec', 'w' do |io| + io.write b.to_ruby + end + + system @git, 'add', 'b.gemspec' + system @git, 'commit', '--quiet', '-m', 'add b/b.gemspec' + end + + FileUtils.touch 'c.gemspec' + + system @git, 'add', 'c.gemspec' + system @git, 'commit', '--quiet', '-m', 'add c.gemspec' + end + + specs = nil + + capture_io do + specs = source.specs + end + + assert_equal %w[a-1 b-1], specs.map { |spec| spec.full_name } + end + def test_uri_hash assert_equal @hash, @source.uri_hash |