diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-12 00:16:41 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-12 00:16:41 +0000 |
commit | 44d0a6dcd7563526a8b05ccdfa21d9425b94e62b (patch) | |
tree | e3bc8e5f1284e65a70c61de9a9d349d5fc8a8640 /test/rubygems/test_gem_request_set.rb | |
parent | 8f3934261ad4a7f486d2fffa9c961d7535675d8f (diff) | |
download | ruby-44d0a6dcd7563526a8b05ccdfa21d9425b94e62b.tar.gz |
* lib/rubygems: Update to RubyGems master b9213d7. Changes include:
Fixed tests on Windows (I hope) by forcing platform for
platform-dependent tests.
Fixed File.exists? warnings.
Improved testing infrastructure.
* test/rubygems: ditto.
* test/rdoc/test_rdoc_rubygems_hook.rb: Switch to util_spec like
RubyGems.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_request_set.rb')
-rw-r--r-- | test/rubygems/test_gem_request_set.rb | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/test/rubygems/test_gem_request_set.rb b/test/rubygems/test_gem_request_set.rb index 4aaa15ac68..9b215c2bc7 100644 --- a/test/rubygems/test_gem_request_set.rb +++ b/test/rubygems/test_gem_request_set.rb @@ -160,6 +160,37 @@ class TestGemRequestSet < Gem::TestCase assert_equal %w!c-2 b-2 a-2!, names end + def test_install + spec_fetcher do |fetcher| + fetcher.gem "a", "1", "b" => "= 1" + fetcher.gem "b", "1" + + fetcher.clear + end + + rs = Gem::RequestSet.new + rs.gem 'a' + + rs.resolve + + reqs = [] + installers = [] + + installed = rs.install({}) do |req, installer| + reqs << req + installers << installer + end + + assert_equal %w[b-1 a-1], reqs.map { |req| req.full_name } + assert_equal %w[b-1 a-1], + installers.map { |installer| installer.spec.full_name } + + assert_path_exists File.join @gemhome, 'specifications', 'a-1.gemspec' + assert_path_exists File.join @gemhome, 'specifications', 'b-1.gemspec' + + assert_equal %w[b-1 a-1], installed.map { |s| s.full_name } + end + def test_install_into spec_fetcher do |fetcher| fetcher.gem "a", "1", "b" => "= 1" @@ -173,8 +204,8 @@ class TestGemRequestSet < Gem::TestCase installed = rs.install_into @tempdir - assert File.exists?(File.join(@tempdir, "specifications", "a-1.gemspec")) - assert File.exists?(File.join(@tempdir, "specifications", "b-1.gemspec")) + assert_path_exists File.join @tempdir, 'specifications', 'a-1.gemspec' + assert_path_exists File.join @tempdir, 'specifications', 'b-1.gemspec' assert_equal %w!b-1 a-1!, installed.map { |s| s.full_name } end |