diff options
-rw-r--r-- | lib/bundler/definition.rb | 4 | ||||
-rw-r--r-- | spec/commands/update_spec.rb | 41 |
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 |