summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-03-17 13:39:20 +0100
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-03-23 17:18:49 +0900
commit4e7c39f98ceaf5160d9a97b7d2405623f972773a (patch)
tree30239c9d71ca5f1188fc672c73b8cfdc9d85ed63 /spec/bundler
parentacf12b6dfdd94ce1da55eaf2dfacc75135385c2a (diff)
downloadruby-4e7c39f98ceaf5160d9a97b7d2405623f972773a.tar.gz
Don't remove RUBY platform when healing a lockfile with missing specs
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/lock/lockfile_spec.rb2
-rw-r--r--spec/bundler/support/platforms.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/spec/bundler/lock/lockfile_spec.rb b/spec/bundler/lock/lockfile_spec.rb
index dd656ae022..78130d8f15 100644
--- a/spec/bundler/lock/lockfile_spec.rb
+++ b/spec/bundler/lock/lockfile_spec.rb
@@ -1262,7 +1262,7 @@ RSpec.describe "the lockfile format" do
indirect_dependency (1.2.3)
PLATFORMS
- #{lockfile_platforms}
+ #{formatted_lockfile_platforms(*["ruby", generic_local_platform].uniq)}
DEPENDENCIES
direct_dependency
diff --git a/spec/bundler/support/platforms.rb b/spec/bundler/support/platforms.rb
index 89a8d45ffd..eca1b2e60d 100644
--- a/spec/bundler/support/platforms.rb
+++ b/spec/bundler/support/platforms.rb
@@ -96,7 +96,11 @@ module Spec
end
def lockfile_platforms(*extra)
- [local_platform, *extra].map(&:to_s).sort.join("\n ")
+ formatted_lockfile_platforms(local_platform, *extra)
+ end
+
+ def formatted_lockfile_platforms(*platforms)
+ platforms.map(&:to_s).sort.join("\n ")
end
end
end