summaryrefslogtreecommitdiff
path: root/test/rubygems/test_gem_config_file.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-14 03:30:02 +0000
commit4de117a61517e839f2c45eaf45d56fc243d6d5b2 (patch)
tree7cb5af7a7eb513e5dddf5e343746b1611e628387 /test/rubygems/test_gem_config_file.rb
parente548c09d429a5136285ea81aed418685359ed124 (diff)
* lib/rubygems: Update to RubyGems 2.4.1 master(713ab65)
Complete history at: https://github.com/rubygems/rubygems/blob/master/History.txt#L3-L216 * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_config_file.rb')
-rw-r--r--test/rubygems/test_gem_config_file.rb26
1 files changed, 19 insertions, 7 deletions
diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb
index e9cd33579d..5077f37359 100644
--- a/test/rubygems/test_gem_config_file.rb
+++ b/test/rubygems/test_gem_config_file.rb
@@ -234,16 +234,19 @@ if you believe they were disclosed to a third party.
end
def test_handle_arguments_debug
- old_dollar_DEBUG = $DEBUG
assert_equal false, $DEBUG
args = %w[--debug]
- @cfg.handle_arguments args
+ _, err = capture_io do
+ @cfg.handle_arguments args
+ end
+
+ assert_match 'NOTE', err
assert_equal true, $DEBUG
ensure
- $DEBUG = old_dollar_DEBUG
+ $DEBUG = false
end
def test_handle_arguments_override
@@ -377,6 +380,9 @@ if you believe they were disclosed to a third party.
fp.puts ":verbose: false"
fp.puts ":sources:"
fp.puts " - http://more-gems.example.com"
+ fp.puts ":ssl_verify_mode: 2"
+ fp.puts ":ssl_ca_cert: /nonexistent/ca_cert.pem"
+ fp.puts ":ssl_client_cert: /nonexistent/client_cert.pem"
fp.puts "install: --wrappers"
end
@@ -399,6 +405,10 @@ if you believe they were disclosed to a third party.
assert_equal false, @cfg.update_sources, 'update_sources'
assert_equal false, @cfg.verbose, 'verbose'
+ assert_equal 2, @cfg.ssl_verify_mode
+ assert_equal '/nonexistent/ca_cert.pem', @cfg.ssl_ca_cert
+ assert_equal '/nonexistent/client_cert.pem', @cfg.ssl_client_cert
+
assert_equal '--wrappers --no-rdoc', @cfg[:install], 'install'
assert_equal %w[http://even-more-gems.example.com], Gem.sources
@@ -409,11 +419,13 @@ if you believe they were disclosed to a third party.
fp.puts "some-non-yaml-hash-string"
end
- # Avoid writing stuff to output when running tests
- Gem::ConfigFile.class_eval { def warn(args); end }
+ begin
+ verbose, $VERBOSE = $VERBOSE, nil
- # This should not raise exception
- util_config_file
+ util_config_file
+ ensure
+ $VERBOSE = verbose
+ end
end
def test_load_ssl_verify_mode_from_config