diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-06-14 12:53:46 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-06-23 19:40:12 -0500 |
commit | fe7ed25f319f4bec6ad4856fd45093e4404c0c8e (patch) | |
tree | 833f56c7bb5ce00c31ca6711a26a3f258d1040e0 /spec/install/gemfile | |
parent | 049e700d467e36778f4f799fdb4bede3bc871f5e (diff) | |
download | bundler-fe7ed25f319f4bec6ad4856fd45093e4404c0c8e.tar.gz |
Put new source pinning specs behind a feature flag
Also update them to modern bundler test syntax
Diffstat (limited to 'spec/install/gemfile')
-rw-r--r-- | spec/install/gemfile/sources_spec.rb | 102 |
1 files changed, 53 insertions, 49 deletions
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb index d596331276..9d727118de 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -271,74 +271,78 @@ RSpec.describe "bundle install with gems on multiple sources" do end context "when a top-level gem has an indirect dependency" do - before do - build_repo gem_repo2 do - build_gem "depends_on_rack", "1.0.1" do |s| - s.add_dependency "rack" + context "when lockfile_uses_separate_rubygems_sources is set" do + before { bundle! "config lockfile_uses_separate_rubygems_sources true" } + + before do + build_repo gem_repo2 do + build_gem "depends_on_rack", "1.0.1" do |s| + s.add_dependency "rack" + end end - end - build_repo gem_repo3 do - build_gem "unrelated_gem", "1.0.0" - end + build_repo gem_repo3 do + build_gem "unrelated_gem", "1.0.0" + end - gemfile <<-G - source "file://#{gem_repo2}" + gemfile <<-G + source "file://#{gem_repo2}" - gem "depends_on_rack" + gem "depends_on_rack" - source "file://#{gem_repo3}" do - gem "unrelated_gem" - end - G - end + source "file://#{gem_repo3}" do + gem "unrelated_gem" + end + G + end - context "and the dependency is only in the top-level source" do - before do - update_repo gem_repo2 do - build_gem "rack", "1.0.0" + context "and the dependency is only in the top-level source" do + before do + update_repo gem_repo2 do + build_gem "rack", "1.0.0" + end end - end - it "installs all gems without warning" do - bundle :install - expect(out).not_to include("Warning") - should_be_installed("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0") + it "installs all gems without warning" do + bundle :install + expect(out).not_to include("Warning") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0") + end end - end - context "and the dependency is only in a pinned source" do - before do - update_repo gem_repo3 do - build_gem "rack", "1.0.0" do |s| - s.write "lib/rack.rb", "RACK = 'FAIL'" + context "and the dependency is only in a pinned source" do + before do + update_repo gem_repo3 do + build_gem "rack", "1.0.0" do |s| + s.write "lib/rack.rb", "RACK = 'FAIL'" + end end end - end - it "does not find the dependency" do - bundle :install - expect(out).to include("Could not find gem 'rack (>= 0) ruby'") + it "does not find the dependency" do + bundle :install + expect(out).to include("Could not find gem 'rack (>= 0) ruby'") + end end - end - context "and the dependency is in both the top-level and a pinned source" do - before do - update_repo gem_repo2 do - build_gem "rack", "1.0.0" - end + context "and the dependency is in both the top-level and a pinned source" do + before do + update_repo gem_repo2 do + build_gem "rack", "1.0.0" + end - update_repo gem_repo3 do - build_gem "rack", "1.0.0" do |s| - s.write "lib/rack.rb", "RACK = 'FAIL'" + update_repo gem_repo3 do + build_gem "rack", "1.0.0" do |s| + s.write "lib/rack.rb", "RACK = 'FAIL'" + end end end - end - it "installs the dependency from the top-level source without warning" do - bundle :install - expect(out).not_to include("Warning") - should_be_installed("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0") + it "installs the dependency from the top-level source without warning" do + bundle :install + expect(out).not_to include("Warning") + expect(the_bundle).to include_gems("depends_on_rack 1.0.1", "rack 1.0.0", "unrelated_gem 1.0.0") + end end end end |