aboutsummaryrefslogtreecommitdiffstats
path: root/spec/bundler/support/platforms.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/support/platforms.rb')
-rw-r--r--spec/bundler/support/platforms.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/bundler/support/platforms.rb b/spec/bundler/support/platforms.rb
index a2a3afba00..002350114b 100644
--- a/spec/bundler/support/platforms.rb
+++ b/spec/bundler/support/platforms.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
module Spec
module Platforms
include Bundler::GemHelpers
@@ -43,6 +44,10 @@ module Spec
generic_local_platform
end
+ def specific_local_platform
+ Bundler.local_platform
+ end
+
def not_local
all_platforms.find {|p| p != generic_local_platform }
end
@@ -94,5 +99,18 @@ module Spec
def not_local_patchlevel
9999
end
+
+ def lockfile_platforms(*platforms)
+ platforms = local_platforms if platforms.empty?
+ platforms.map(&:to_s).sort.join("\n ")
+ end
+
+ def local_platforms
+ if Bundler::VERSION.split(".").first.to_i > 1
+ [local, specific_local_platform]
+ else
+ [local]
+ end
+ end
end
end