mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[rubygems/rubygems] Set config_file_name to the value of ENV["GEMRC"] if available
https://github.com/rubygems/rubygems/commit/471239f1fa
This commit is contained in:
parent
6f60ead756
commit
7990d8dc50
2 changed files with 8 additions and 2 deletions
|
@ -473,7 +473,7 @@ if you believe they were disclosed to a third party.
|
|||
|
||||
private
|
||||
def set_config_file_name(args)
|
||||
@config_file_name = nil
|
||||
@config_file_name = ENV["GEMRC"] || nil
|
||||
need_config_file_name = false
|
||||
|
||||
args.each do |arg|
|
||||
|
|
|
@ -19,7 +19,7 @@ class TestGemConfigFile < Gem::TestCase
|
|||
Gem::ConfigFile::PLATFORM_DEFAULTS.clear
|
||||
|
||||
@env_gemrc = ENV['GEMRC']
|
||||
ENV['GEMRC'] = ''
|
||||
ENV['GEMRC'] = nil
|
||||
|
||||
util_config_file
|
||||
end
|
||||
|
@ -167,6 +167,12 @@ class TestGemConfigFile < Gem::TestCase
|
|||
assert_equal 2048, @cfg.bulk_threshold
|
||||
end
|
||||
|
||||
def test_set_config_file_name_from_environment_variable
|
||||
ENV['GEMRC'] = "/tmp/.gemrc"
|
||||
cfg = Gem::ConfigFile.new([])
|
||||
assert_equal cfg.config_file_name, "/tmp/.gemrc"
|
||||
end
|
||||
|
||||
def test_api_keys
|
||||
assert_nil @cfg.instance_variable_get :@api_keys
|
||||
|
||||
|
|
Loading…
Reference in a new issue