diff options
| author | Yuta Saito <kateinoigakukun@gmail.com> | 2024-03-04 14:15:10 +0900 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-03-04 06:36:29 +0000 |
| commit | ef5af32799b04da61bbd1bdaf464012a755c4936 (patch) | |
| tree | 59ad2e6a376e258e0be2b9650b8c5a72170ed95f /test | |
| parent | 2d8788e90cd535933c0f444112d465cffc4c71b1 (diff) | |
[rubygems/rubygems] Clear `RUBY_CODESIGN` env var while running tests
The `RUBY_CODESIGN` environment variable is used by mkmf-generated
Makefile to sign extension bundles on macOS. The variable specifies a
key identifier to use for signing given by the user. However, the key
is usually stored in `$HOME/Library/Keychains` directory, and the test
suite creates a fake `$HOME` directory. This causes the test suite to
try to find the specified key from the fake home directory, which
results in a failure.
https://github.com/rubygems/rubygems/commit/ddcfc65bf7
Diffstat (limited to 'test')
| -rw-r--r-- | test/rubygems/helper.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/rubygems/helper.rb b/test/rubygems/helper.rb index 9ca2e269e3..ed9e34a906 100644 --- a/test/rubygems/helper.rb +++ b/test/rubygems/helper.rb @@ -351,6 +351,10 @@ class Gem::TestCase < Test::Unit::TestCase Dir.chdir @tempdir ENV["HOME"] = @userhome + # Remove "RUBY_CODESIGN", which is used by mkmf-generated Makefile to + # sign extension bundles on macOS, to avoid trying to find the specified key + # from the fake $HOME/Library/Keychains directory. + ENV.delete "RUBY_CODESIGN" Gem.instance_variable_set :@config_file, nil Gem.instance_variable_set :@user_home, nil Gem.instance_variable_set :@config_home, nil |
