diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-11-28 12:42:03 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-11-28 15:37:24 +0100 |
commit | 4eb2add1c358470297af751f5eb51139671e7f4d (patch) | |
tree | f9e484f58832c359c65272fb3e40598284c0ec4b /spec/runtime | |
parent | b0014b7b4c03ecc162e6c8cc2a1ef5ce27c8e3f8 (diff) | |
download | bundler-4eb2add1c358470297af751f5eb51139671e7f4d.tar.gz |
Split default gem activation specs
Currently they're using a single Gemfile with all default gems, and
making sure that all default gems can be activated. It a single default
gem is activated by bundler, this results in huge errors messages
because the spec still tries to activate all default gems present in the
Gemfile, and fails for all of them.
Instead, we separate on spec for each default gem, which makes error
messages smaller, and helps figuring out the root cause of the issue. In
this case, the `uri` gem.
Diffstat (limited to 'spec/runtime')
-rw-r--r-- | spec/runtime/setup_spec.rb | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 168b3480f9..10adbf773b 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -1263,42 +1263,36 @@ end expect(out).to eq("{}") end - let(:default_gems) do - Gem::Specification.select(&:default_gem?).map(&:name).reject {|g| exemptions.include?(g) } - end + Gem::Specification.select(&:default_gem?).map(&:name).each do |g| + it "activates newer versions of #{g}" do + skip if exemptions.include?(g) - it "activates newer versions of default gems" do - build_repo4 do - default_gems.each do |g| + build_repo4 do build_gem g, "999999" end - end - install_gemfile! <<-G - source "#{file_uri_for(gem_repo4)}" - #{default_gems}.each do |g| - gem g, "999999" - end - G + install_gemfile! <<-G + source "#{file_uri_for(gem_repo4)}" + gem "#{g}", "999999" + G - expect(the_bundle).to include_gems(*default_gems.map {|g| "#{g} 999999" }) - end + expect(the_bundle).to include_gem("#{g} 999999") + end - it "activates older versions of default gems" do - build_repo4 do - default_gems.each do |g| + it "activates older versions of #{g}" do + skip if exemptions.include?(g) + + build_repo4 do build_gem g, "0.0.0.a" end - end - install_gemfile! <<-G - source "#{file_uri_for(gem_repo4)}" - #{default_gems}.each do |g| - gem g, "0.0.0.a" - end - G + install_gemfile! <<-G + source "#{file_uri_for(gem_repo4)}" + gem "#{g}", "0.0.0.a" + G - expect(the_bundle).to include_gems(*default_gems.map {|g| "#{g} 0.0.0.a" }) + expect(the_bundle).to include_gem("#{g} 0.0.0.a") + end end end end |