diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
commit | c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d (patch) | |
tree | 9f558dafa363f4f0118d504a50cd4461e2821cd1 /test/rubygems/test_gem_dependency.rb | |
parent | 6b05153a3a75b74b64553d6a46f501d9ee0f0376 (diff) | |
download | ruby-c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d.tar.gz |
Merge rubygems master.
This is RC version of Rubygems 2.7.0.
https://github.com/rubygems/rubygems/commit/688fb7e83c13c3fe7c2bb03c49a2db4c82852aee
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_dependency.rb')
-rw-r--r-- | test/rubygems/test_gem_dependency.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_dependency.rb b/test/rubygems/test_gem_dependency.rb index 0d501f567f..d7eec3c090 100644 --- a/test/rubygems/test_gem_dependency.rb +++ b/test/rubygems/test_gem_dependency.rb @@ -338,6 +338,34 @@ class TestGemDependency < Gem::TestCase assert_match "Could not find 'a' (= 2.0) - did find: [a-1.0]", e.message end + def test_to_specs_respects_bundler_version + b = util_spec 'bundler', '2.0.0.pre.1' + b_1 = util_spec 'bundler', '1' + install_specs b, b_1 + + b_file = File.join b.gem_dir, 'lib', 'bundler', 'setup.rb' + + write_file b_file do |io| + io.puts '# setup.rb' + end + + dep = Gem::Dependency.new "bundler", ">= 0.a" + + assert_equal [b, b_1], dep.to_specs + + Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["3.5", "reason"]) do + e = assert_raises Gem::MissingSpecVersionError do + dep.to_specs + end + + assert_match "Could not find 'bundler' (3.5) required by reason.\nTo update to the lastest version installed on your system, run `bundle update --bundler`.\nTo install the missing version, run `gem install bundler:3.5`\n", e.message + end + + Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["2.0.0.pre.1", "reason"]) do + assert_equal [b], dep.to_specs + end + end + def test_to_specs_indicates_total_gem_set_size a = util_spec 'a', '1.0' install_specs a |