Skip to content

Commit

Permalink
Explicitly define @default_specifications_dir for tests
Browse files Browse the repository at this point in the history
Resetting `@default_specifications_dir` to nil means that the
`Gem.default_specifications_dir` needs to be invoked. However, given
that this method might be overriden by operating_system.rb and similar,
this might lead to various test failures. Providing the default value
makes the issues go away.
  • Loading branch information
voxik committed Nov 10, 2023
1 parent e67112c commit e198095
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 @@ -372,7 +372,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 e198095

Please sign in to comment.