summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2024-07-09 19:13:59 +0200
committergit <svn-admin@ruby-lang.org>2024-07-17 11:14:53 +0000
commit3c3cce13c636313649ab2417d09b3b080da616d4 (patch)
tree28a312bd55c282acd825cd45f516ab3b9040e468 /spec
parent58aebcbce14bc87f76af605f4c7f21540fc030f2 (diff)
[rubygems/rubygems] Fix another case of `bundle lock --add-platform` doing nothing
https://github.com/rubygems/rubygems/commit/0629e27dda
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/lock_spec.rb56
1 files changed, 56 insertions, 0 deletions
diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb
index 989f4fc154..450436372e 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -629,6 +629,62 @@ RSpec.describe "bundle lock" do
expect(lockfile.platforms).to match_array(default_platform_list(java, x86_mingw32))
end
+ it "supports adding new platforms, when most specific locked platform is not the current platform, and current resolve is not compatible with the target platform" do
+ simulate_platform "arm64-darwin-23" do
+ build_repo4 do
+ build_gem "foo" do |s|
+ s.platform = "arm64-darwin"
+ end
+
+ build_gem "foo" do |s|
+ s.platform = "java"
+ end
+ end
+
+ gemfile <<-G
+ source "https://gem.repo4"
+
+ gem "foo"
+ G
+
+ lockfile <<-L
+ GEM
+ remote: https://gem.repo4/
+ specs:
+ foo (1.0-arm64-darwin)
+
+ PLATFORMS
+ arm64-darwin
+
+ DEPENDENCIES
+ foo
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+
+ bundle "lock --add-platform java"
+
+ expect(lockfile).to eq <<~L
+ GEM
+ remote: https://gem.repo4/
+ specs:
+ foo (1.0-arm64-darwin)
+ foo (1.0-java)
+
+ PLATFORMS
+ arm64-darwin
+ java
+
+ DEPENDENCIES
+ foo
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+ end
+
it "supports adding new platforms with force_ruby_platform = true" do
lockfile <<-L
GEM