diff options
author | Tim Moore <tmoore@incrementalism.net> | 2015-05-29 09:14:52 +1000 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-06-23 19:40:12 -0500 |
commit | 049e700d467e36778f4f799fdb4bede3bc871f5e (patch) | |
tree | 7c6d549a6017bd2aeeeb6fb4e1703d35a9b9f0b4 | |
parent | 93fd9826f1b0a428175f6c76d8e33d6afc900497 (diff) | |
download | bundler-049e700d467e36778f4f799fdb4bede3bc871f5e.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 b7f8b3d99e..d596331276 100644 --- a/spec/install/gemfile/sources_spec.rb +++ b/spec/install/gemfile/sources_spec.rb @@ -134,7 +134,7 @@ RSpec.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| @@ -270,6 +270,79 @@ RSpec.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 |