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 | 126b1dd75918c1b327568603a73e3930f0e88e30 (patch) | |
tree | 9f558dafa363f4f0118d504a50cd4461e2821cd1 /test/rubygems/test_kernel.rb | |
parent | 6ae958679382361364aec4df7e5e309c5318afd3 (diff) | |
download | ruby-126b1dd75918c1b327568603a73e3930f0e88e30.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_kernel.rb')
-rw-r--r-- | test/rubygems/test_kernel.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/rubygems/test_kernel.rb b/test/rubygems/test_kernel.rb index b565c62f4a..f7d3988ce3 100644 --- a/test/rubygems/test_kernel.rb +++ b/test/rubygems/test_kernel.rb @@ -90,4 +90,34 @@ class TestKernel < Gem::TestCase assert gem('a', '= 1'), "Should load" refute $:.any? { |p| %r{a-1/bin} =~ p } end + + def test_gem_bundler + quick_gem 'bundler', '1' + quick_gem 'bundler', '2.a' + + assert gem('bundler') + assert $:.any? { |p| %r{bundler-1/lib} =~ p } + end + + def test_gem_bundler_missing_bundler_version + Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["55", "reason"]) do + quick_gem 'bundler', '1' + quick_gem 'bundler', '2.a' + + e = assert_raises Gem::MissingSpecVersionError do + gem('bundler') + end + assert_match "Could not find 'bundler' (55) required by reason.", e.message + end + end + + def test_gem_bundler_inferred_bundler_version + Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["1", "reason"]) do + quick_gem 'bundler', '1' + quick_gem 'bundler', '2.a' + + assert gem('bundler', '>= 0.a') + assert $:.any? { |p| %r{bundler-1/lib} =~ p } + end + end end |