Skip to content

Commit

Permalink
[rubygems/rubygems] Explicitly define @default_specifications_dir f…
Browse files Browse the repository at this point in the history
…or tests

Resetting `@default_specifications_dir` to `nil` means that the
`Gem.default_specifications_dir` needs to be invoked. However, given
that this method might be overridden by operating_system.rb and similar,
this might lead to various test failures. Providing the default value
makes the issues go away.

rubygems/rubygems@59626cb650
  • Loading branch information
voxik authored and hsbt committed Nov 13, 2023
1 parent 3053e89 commit babc029
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/rubygems/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def setup

ENV["GEM_PRIVATE_KEY_PASSPHRASE"] = PRIVATE_KEY_PASSPHRASE

Gem.instance_variable_set(:@default_specifications_dir, nil)
Gem.instance_variable_set(:@default_specifications_dir, File.join(@gemhome, "specifications", "default"))
if Gem.java_platform?
@orig_default_gem_home = RbConfig::CONFIG["default_gem_home"]
RbConfig::CONFIG["default_gem_home"] = @gemhome
Expand Down

0 comments on commit babc029

Please sign in to comment.