1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Merge rubygems master.

This is RC version of Rubygems 2.7.0.
  688fb7e83c

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2017-10-08 01:32:18 +00:00
parent 6b05153a3a
commit c00e84327f
96 changed files with 2021 additions and 701 deletions

View file

@ -383,6 +383,44 @@ class TestGemRequire < Gem::TestCase
assert_equal %w(a-1), loaded_spec_names
end
def test_require_bundler
b1 = new_spec('bundler', '1', nil, "lib/bundler/setup.rb")
b2a = new_spec('bundler', '2.a', nil, "lib/bundler/setup.rb")
install_specs b1, b2a
require "rubygems/bundler_version_finder"
$:.clear
assert_require 'bundler/setup'
assert_equal %w[bundler-2.a], loaded_spec_names
assert_empty unresolved_names
end
def test_require_bundler_missing_bundler_version
Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["55", "reason"]) do
b1 = new_spec('bundler', '1.999999999', nil, "lib/bundler/setup.rb")
b2a = new_spec('bundler', '2.a', nil, "lib/bundler/setup.rb")
install_specs b1, b2a
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_require_bundler_with_bundler_version
Gem::BundlerVersionFinder.stub(:bundler_version_with_reason, ["1", "reason"]) do
b1 = new_spec('bundler', '1.999999999', nil, "lib/bundler/setup.rb")
b2 = new_spec('bundler', '2', nil, "lib/bundler/setup.rb")
install_specs b1, b2
$:.clear
assert_require 'bundler/setup'
assert_equal %w[bundler-1.999999999], loaded_spec_names
end
end
def silence_warnings
old_verbose, $VERBOSE = $VERBOSE, false
yield