summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2025-04-12 21:06:34 +0200
committerHiroshi SHIBATA <[email protected]>2025-04-15 16:47:22 +0900
commitb8b4c15695ac4053b9d6c203e3948ea545be726b (patch)
tree411489c8c5411b0be1716d346eeb72201a0718b1 /spec
parent1929e73a36958aee963d4e843716a3927d641d69 (diff)
[rubygems/rubygems] Let `bundle lock --normalize-platforms` remove invalid platforms
https://github.com/rubygems/rubygems/commit/c39d2f84fd
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/commands/lock_spec.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/bundler/commands/lock_spec.rb b/spec/bundler/commands/lock_spec.rb
index 2d69737b70..4554248eee 100644
--- a/spec/bundler/commands/lock_spec.rb
+++ b/spec/bundler/commands/lock_spec.rb
@@ -2619,4 +2619,49 @@ RSpec.describe "bundle lock" do
end
end
end
+
+ describe "--normalize-platforms with gems without generic variant" do
+ let(:original_lockfile) do
+ <<~L
+ GEM
+ remote: https://gem.repo4/
+ specs:
+ sorbet-static (1.0-x86_64-linux)
+
+ PLATFORMS
+ ruby
+ x86_64-linux
+
+ DEPENDENCIES
+ sorbet-static
+
+ BUNDLED WITH
+ #{Bundler::VERSION}
+ L
+ end
+
+ before do
+ build_repo4 do
+ build_gem "sorbet-static" do |s|
+ s.platform = "x86_64-linux"
+ end
+ end
+
+ gemfile <<~G
+ source "https://gem.repo4"
+
+ gem "sorbet-static"
+ G
+
+ lockfile original_lockfile
+ end
+
+ it "removes invalid platforms" do
+ simulate_platform "x86_64-linux" do
+ bundle "lock --normalize-platforms"
+ end
+
+ expect(lockfile).to eq(original_lockfile.gsub(/^ ruby\n/m, ""))
+ end
+ end
end