diff options
author | Tim Moore <tmoore@incrementalism.net> | 2015-05-29 09:14:52 +1000 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-06-27 16:27:22 -0500 |
commit | ca01935f9a7e43ac8726e9244d468e8c516c7cb9 (patch) | |
tree | c5330ad91b9721b1950bfa6d764794080dd2aea4 | |
parent | 051e0691d1eec48a98e53b141c8a1dac22d4fe68 (diff) | |
download | bundler-ca01935f9a7e43ac8726e9244d468e8c516c7cb9.tar.gz |
Failing spec for #3671.
-rw-r--r-- | spec/install/gemfile/sources_spec.rb | 75 |
1 files changed, 74 insertions, 1 deletions
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb index 69e8c12ee9..efe3c9a0b7 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -110,7 +110,7 @@ describe "bundle install with gems on multiple sources" do end end - context "with an indirect dependency" do + context "when a pinned gem has an indirect dependency" do before do build_repo gem_repo3 do build_gem "depends_on_rack", "1.0.1" do |s| @@ -226,6 +226,79 @@ describe "bundle install with gems on multiple sources" do end 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" + end + end + + build_repo gem_repo3 do + build_gem "unrelated_gem", "1.0.0" + end + + gemfile <<-G + source "file://#{gem_repo2}" + + gem "depends_on_rack" + + 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" + 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") + 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'" + end + end + end + + it "does not find the dependency" do + bundle :install + expect(out).to include("Could not find gem 'rack (>= 0) ruby'") + 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 + + update_repo gem_repo3 do + build_gem "rack", "1.0.0" do |s| + s.write "lib/rack.rb", "RACK = 'FAIL'" + 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") + end + end + end + context "with a gem that is only found in the wrong source" do before do build_repo gem_repo3 do |