summaryrefslogtreecommitdiff
path: root/spec/bundler/support
diff options
context:
space:
mode:
authorBo Anderson <mail@boanderson.me>2022-10-15 22:51:39 +0100
committergit <svn-admin@ruby-lang.org>2022-11-08 17:05:19 +0000
commit0df47fdaf9c8bcfad0180aab81f9ceb162b360a1 (patch)
tree94264b4a1ca47000fb4a3eac7e7c201476ec0d26 /spec/bundler/support
parent2244d5084e32fea801bff1060ef528769bebaa36 (diff)
downloadruby-0df47fdaf9c8bcfad0180aab81f9ceb162b360a1.tar.gz
[rubygems/rubygems] Add tests for universal Ruby with arch-specific prebuilt gems
https://github.com/rubygems/rubygems/commit/11229b16c3
Diffstat (limited to 'spec/bundler/support')
-rw-r--r--spec/bundler/support/hax.rb5
-rw-r--r--spec/bundler/support/helpers.rb8
2 files changed, 13 insertions, 0 deletions
diff --git a/spec/bundler/support/hax.rb b/spec/bundler/support/hax.rb
index da67e8c5d1..76e3b05ee1 100644
--- a/spec/bundler/support/hax.rb
+++ b/spec/bundler/support/hax.rb
@@ -1,5 +1,10 @@
# frozen_string_literal: true
+if ENV["BUNDLER_SPEC_RUBY_PLATFORM"]
+ Object.send(:remove_const, :RUBY_PLATFORM)
+ RUBY_PLATFORM = ENV["BUNDLER_SPEC_RUBY_PLATFORM"]
+end
+
module Gem
def self.ruby=(ruby)
@ruby = ruby
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index dfc358796a..1541f903c7 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -432,6 +432,14 @@ module Spec
pristine_system_gems :bundler
end
+ def simulate_ruby_platform(ruby_platform)
+ old = ENV["BUNDLER_SPEC_RUBY_PLATFORM"]
+ ENV["BUNDLER_SPEC_RUBY_PLATFORM"] = ruby_platform.to_s
+ yield
+ ensure
+ ENV["BUNDLER_SPEC_RUBY_PLATFORM"] = old
+ end
+
def simulate_platform(platform)
old = ENV["BUNDLER_SPEC_PLATFORM"]
ENV["BUNDLER_SPEC_PLATFORM"] = platform.to_s