summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2016-10-13 17:52:46 -0700
committerAndre Arko <andre@arko.net>2016-10-13 17:52:47 -0700
commit6d58d5a63fe2eb1c372211a8e2ebd3e584cc7f54 (patch)
tree51c798f0035998490038f68c9dff29127d918ea9
parenta4adf1245fc74c2ab6b540ec25ea152da8bc1b50 (diff)
downloadbundler-6d58d5a63fe2eb1c372211a8e2ebd3e584cc7f54.tar.gz
add a failing spec for not-found gems
This is a kind of weird and specific situation: If, and only if, some version of a gem is installed into system gems (e.g. rack 1.0), then trying to resolve a different version of that gem from a specific remote source (e.g. rack 2.0.1.1.forked) will fail, even though that gem is in fact available from that soure. Uninstalling the unrelated version of rack from system gems completely solves this problem. Alternately, running `bundle update rack` instead of `bundle install` also completely solves this problem. From this I speculate that we are unfairly withholding the rack 2.0.1.1.forked spec from the resolver, even though it was provided by the source.
-rw-r--r--spec/install/gemfile/sources_spec.rb71
1 files changed, 71 insertions, 0 deletions
diff --git a/spec/install/gemfile/sources_spec.rb b/spec/install/gemfile/sources_spec.rb
index fd11c3feab..aae5953f31 100644
--- a/spec/install/gemfile/sources_spec.rb
+++ b/spec/install/gemfile/sources_spec.rb
@@ -449,4 +449,75 @@ describe "bundle install with gems on multiple sources" do
end
end
end
+
+ context "when a gem is installed to system gems" do
+ before do
+ install_gemfile! <<-G
+ source "file://#{gem_repo1}"
+ gem "rack"
+ G
+ end
+
+ context "and the gemfile changes" do
+ it "is still able to find that gem from remote sources" do
+ source_uri = "file://#{gem_repo1}"
+ second_uri = "file://#{gem_repo4}"
+
+ build_repo4 do
+ build_gem "rack", "2.0.1.1.forked"
+ build_gem "thor", "0.19.1.1.forked"
+ end
+
+ # When this gemfile is installed...
+ gemfile <<-G
+ # frozen_string_literal: true
+ source "#{source_uri}"
+
+ source "#{second_uri}" do
+ gem "rack", "2.0.1.1.forked"
+ gem "thor", "0.19.1.1.forked"
+ end
+ gem "rack-obama"
+ G
+
+ # It creates this lockfile.
+ lockfile <<-L
+ GEM
+ remote: #{source_uri}/
+ remote: #{second_uri}/
+ specs:
+ rack (2.0.1.1.forked)
+ rack-obama (1.0)
+ rack
+ thor (0.19.1.1.forked)
+
+ PLATFORMS
+ ruby
+
+ DEPENDENCIES
+ rack (= 2.0.1.1.forked)!
+ rack-obama
+ thor!
+
+ BUNDLED WITH
+ 1.13.3
+ L
+
+ # Then we change the Gemfile by adding a version to thor
+ gemfile <<-G
+ # frozen_string_literal: true
+ source "#{source_uri}"
+
+ source "#{second_uri}" do
+ gem "rack", "2.0.1.1.forked"
+ gem "thor", "0.19.1.1.forked"
+ end
+ gem "rack-obama"
+ G
+
+ # But we should still be able to find rack 2.0.1.1.forked and install it
+ bundle! :install
+ end
+ end
+ end
end