diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-21 23:27:30 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-21 23:27:30 +0000 |
commit | 5307d803f5cce7b14a6afd1d51f6d53ec85ca87d (patch) | |
tree | aac2997a9ff000fbf2f1f9f27077bb7b2403f2c9 /test/rubygems/test_gem_source_git.rb | |
parent | b1529a30e08040b717adef8ac1fa8be1c060e7e1 (diff) | |
download | ruby-5307d803f5cce7b14a6afd1d51f6d53ec85ca87d.tar.gz |
* lib/rubygems: Update to RubyGems master 50a8210. Important changes
in this commit:
RubyGems now automatically checks for gem.deps.rb or Gemfile when
running ruby executables. This behavior is similar to `bundle exec
rake`. This change may be reverted before Ruby 2.1.0 if too many bugs
are found.
* test/rubygems: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 |