diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-09-10 11:07:03 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-09-26 17:48:01 +0900 |
commit | ea5b1361557690569a33204c122a08f2faefdf91 (patch) | |
tree | 721e878e0e3cd705582bd8554f85aa589f609204 /test/rubygems | |
parent | ad638a713a953f62ff598fd820b44a3318f4241e (diff) | |
download | ruby-ea5b1361557690569a33204c122a08f2faefdf91.tar.gz |
[rubygems/rubygems] Fix underscore version for bundler itself
Previously it wouldn't play nice with the bundler version finder.
https://github.com/rubygems/rubygems/commit/d8bb81556d
Diffstat (limited to 'test/rubygems')
-rw-r--r-- | test/rubygems/test_gem.rb | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index b25068405d..110eef6c7f 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb @@ -375,6 +375,40 @@ class TestGem < Gem::TestCase assert_equal %w(bundler-2.0.0), loaded_spec_names end + def test_activate_bin_path_respects_underscore_selection_if_given + bundler_latest = util_spec 'bundler', '2.0.1' do |s| + s.executables = ['bundle'] + end + + bundler_previous = util_spec 'bundler', '1.17.3' do |s| + s.executables = ['bundle'] + end + + install_specs bundler_latest, bundler_previous + + File.open("Gemfile.lock", "w") do |f| + f.write <<-L.gsub(/ {8}/, "") + GEM + remote: https://rubygems.org/ + specs: + + PLATFORMS + ruby + + DEPENDENCIES + + BUNDLED WITH + 2.0.1 + L + end + + File.open("Gemfile", "w") { |f| f.puts('source "https://rubygems.org"') } + + load Gem.activate_bin_path("bundler", "bundle", "= 1.17.3") + + assert_equal %w(bundler-1.17.3), loaded_spec_names + end + def test_self_bin_path_no_exec_name e = assert_raises ArgumentError do Gem.bin_path 'a' |