summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-03-18 17:18:12 +0000
committerThe Bundler Bot <bot@bundler.io>2018-03-18 17:18:12 +0000
commit91a3e3fd69bfb2fa5e5293dbe012c4ada0c7b49b (patch)
treefc2e14822219cceaafc6b1e628aa2cd52d9104f4
parentff6b8712a0337305ba9617e35545b9e8f8cd4a53 (diff)
parent25be4c9f5e1d61e782f4599cece08ba1bc8c7bac (diff)
downloadbundler-91a3e3fd69bfb2fa5e5293dbe012c4ada0c7b49b.tar.gz
Auto merge of #6444 - greysteil:handle-gem-specific-updates-non-local-platform, r=segiddins
Handle updating a specific gem for a non-local platform Fixes https://github.com/bundler/bundler/issues/6350. Kudos to @segiddins for the test.
-rw-r--r--lib/bundler/definition.rb4
-rw-r--r--spec/commands/update_spec.rb41
2 files changed, 43 insertions, 2 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index a50806ba4b..91d34ad150 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -120,8 +120,8 @@ module Bundler
@source_changes = converge_sources
unless @unlock[:lock_shared_dependencies]
- eager_unlock = expand_dependencies(@unlock[:gems])
- @unlock[:gems] = @locked_specs.for(eager_unlock).map(&:name)
+ eager_unlock = expand_dependencies(@unlock[:gems], true)
+ @unlock[:gems] = @locked_specs.for(eager_unlock, [], false, false, false).map(&:name)
end
@dependency_changes = converge_dependencies
diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb
index 799aac1f54..af09c145c1 100644
--- a/spec/commands/update_spec.rb
+++ b/spec/commands/update_spec.rb
@@ -437,6 +437,47 @@ RSpec.describe "bundle update in more complicated situations" do
bundle "update"
expect(the_bundle).to include_gems "thin 1.0"
end
+
+ context "when the lockfile is for a different platform" do
+ before do
+ build_repo4 do
+ build_gem("a", "0.9")
+ build_gem("a", "0.9") {|s| s.platform = "java" }
+ build_gem("a", "1.1")
+ build_gem("a", "1.1") {|s| s.platform = "java" }
+ end
+
+ gemfile <<-G
+ source "file://#{gem_repo4}"
+ gem "a"
+ G
+
+ lockfile <<-L
+ GEM
+ remote: file://#{gem_repo4}
+ specs:
+ a (0.9-java)
+
+ PLATFORMS
+ java
+
+ DEPENDENCIES
+ a
+ L
+
+ simulate_platform linux
+ end
+
+ it "allows updating" do
+ bundle! :update, :all => true
+ expect(the_bundle).to include_gem "a 1.1"
+ end
+
+ it "allows updating a specific gem" do
+ bundle! "update a"
+ expect(the_bundle).to include_gem "a 1.1"
+ end
+ end
end
RSpec.describe "bundle update without a Gemfile.lock" do