diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-04-25 17:29:26 +0200 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-04-28 16:47:22 +0200 |
commit | 17293b25715fe529b2a5cfa3a64fd5fea92636f3 (patch) | |
tree | d186d9d224b09cf847b53d51e5c2c0c67dd88fc6 /spec | |
parent | e241ff1a378beb10f2db1d6d33ed6f4555230537 (diff) | |
download | bundler-17293b25715fe529b2a5cfa3a64fd5fea92636f3.tar.gz |
[Runtime] Print a more helpful error when gem activation conflicts with a default gemseg-test-default-gem-substitutes-are-activated
Diffstat (limited to 'spec')
-rw-r--r-- | spec/runtime/setup_spec.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index b19a81e75f..120aa03d7e 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1197,6 +1197,50 @@ end expect(err).to eq("") expect(out).to eq("{}") end + + let(:default_gems) do + ruby!(<<-RUBY).split("\n") + if Gem::Specification.is_a?(Enumerable) + puts Gem::Specification.select(&:default_gem?).map(&:name) + end + RUBY + end + + it "activates newer versions of default gems" do + build_repo4 do + default_gems.each do |g| + build_gem g, "999999" + end + end + + install_gemfile! <<-G + source "file:#{gem_repo4}" + #{default_gems}.each do |g| + gem g, "999999" + end + G + + expect(the_bundle).to include_gems(*default_gems.map {|g| "#{g} 999999" }) + end + + it "activates older versions of default gems" do + build_repo4 do + default_gems.each do |g| + build_gem g, "0.0.0.a" + end + end + + default_gems.reject! {|g| exemptions.include?(g) } + + install_gemfile! <<-G + source "file:#{gem_repo4}" + #{default_gems}.each do |g| + gem g, "0.0.0.a" + end + G + + expect(the_bundle).to include_gems(*default_gems.map {|g| "#{g} 0.0.0.a" }) + end end end |