summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2022-07-07 09:57:27 +0200
committergit <svn-admin@ruby-lang.org>2022-07-08 02:22:35 +0900
commit7dd0a2258880e433b98267ffd95dd4271c7bbf05 (patch)
treed40943eac7967c9e9162cc746ca2623429038cf1
parentc8b3bd45cc3cae93ae701333202416838ee6a00c (diff)
[rubygems/rubygems] Fix `simulate_windows` helper
It should also set the proper class variable so that `Gem.win_platform?` returns true. https://github.com/rubygems/rubygems/commit/0fbf6904d1
-rw-r--r--spec/bundler/support/hax.rb4
-rw-r--r--spec/bundler/support/helpers.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/spec/bundler/support/hax.rb b/spec/bundler/support/hax.rb
index 3d97b93c5a..ff45bacaed 100644
--- a/spec/bundler/support/hax.rb
+++ b/spec/bundler/support/hax.rb
@@ -14,6 +14,10 @@ module Gem
@default_specifications_dir = nil
end
+ if ENV["BUNDLER_SPEC_WINDOWS"]
+ @@win_platform = true # rubocop:disable Sryle/ClassVars
+ end
+
if ENV["BUNDLER_SPEC_PLATFORM"]
class Platform
@local = new(ENV["BUNDLER_SPEC_PLATFORM"])
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index e995418a4e..03c0df3b50 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/support/helpers.rb
@@ -446,11 +446,15 @@ module Spec
end
def simulate_windows(platform = mswin)
+ old = ENV["BUNDLER_SPEC_WINDOWS"]
+ ENV["BUNDLER_SPEC_WINDOWS"] = "true"
simulate_platform platform do
simulate_bundler_version_when_missing_prerelease_default_gem_activation do
yield
end
end
+ ensure
+ ENV["BUNDLER_SPEC_WINDOWS"] = old
end
def simulate_bundler_version_when_missing_prerelease_default_gem_activation