1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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
This commit is contained in:
David Rodríguez 2022-07-07 09:57:27 +02:00 committed by git
parent c8b3bd45cc
commit 7dd0a22588
2 changed files with 8 additions and 0 deletions

View file

@ -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"])

View file

@ -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