[rubygems/rubygems] Include backtrace with crashes by default
https://github.com/rubygems/rubygems/commit/3cc3bfd371
This commit is contained in:
parent
5a9db23734
commit
f310ac1cb2
@ -39,7 +39,7 @@ require "rbconfig"
|
|||||||
class Gem::ConfigFile
|
class Gem::ConfigFile
|
||||||
include Gem::UserInteraction
|
include Gem::UserInteraction
|
||||||
|
|
||||||
DEFAULT_BACKTRACE = false
|
DEFAULT_BACKTRACE = true
|
||||||
DEFAULT_BULK_THRESHOLD = 1000
|
DEFAULT_BULK_THRESHOLD = 1000
|
||||||
DEFAULT_VERBOSITY = true
|
DEFAULT_VERBOSITY = true
|
||||||
DEFAULT_UPDATE_SOURCES = true
|
DEFAULT_UPDATE_SOURCES = true
|
||||||
|
@ -35,7 +35,7 @@ class TestGemConfigFile < Gem::TestCase
|
|||||||
def test_initialize
|
def test_initialize
|
||||||
assert_equal @temp_conf, @cfg.config_file_name
|
assert_equal @temp_conf, @cfg.config_file_name
|
||||||
|
|
||||||
assert_equal false, @cfg.backtrace
|
assert_equal true, @cfg.backtrace
|
||||||
assert_equal true, @cfg.update_sources
|
assert_equal true, @cfg.update_sources
|
||||||
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
|
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
|
||||||
assert_equal true, @cfg.verbose
|
assert_equal true, @cfg.verbose
|
||||||
@ -239,6 +239,12 @@ if you believe they were disclosed to a third party.
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_handle_arguments_backtrace
|
def test_handle_arguments_backtrace
|
||||||
|
File.open @temp_conf, "w" do |fp|
|
||||||
|
fp.puts ":backtrace: false"
|
||||||
|
end
|
||||||
|
|
||||||
|
util_config_file %W[--config-file=#{@temp_conf}]
|
||||||
|
|
||||||
assert_equal false, @cfg.backtrace
|
assert_equal false, @cfg.backtrace
|
||||||
|
|
||||||
args = %w[--backtrace]
|
args = %w[--backtrace]
|
||||||
@ -275,6 +281,12 @@ if you believe they were disclosed to a third party.
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_handle_arguments_traceback
|
def test_handle_arguments_traceback
|
||||||
|
File.open @temp_conf, "w" do |fp|
|
||||||
|
fp.puts ":backtrace: false"
|
||||||
|
end
|
||||||
|
|
||||||
|
util_config_file %W[--config-file=#{@temp_conf}]
|
||||||
|
|
||||||
assert_equal false, @cfg.backtrace
|
assert_equal false, @cfg.backtrace
|
||||||
|
|
||||||
args = %w[--traceback]
|
args = %w[--traceback]
|
||||||
@ -288,7 +300,7 @@ if you believe they were disclosed to a third party.
|
|||||||
assert_equal @temp_conf, @cfg.config_file_name
|
assert_equal @temp_conf, @cfg.config_file_name
|
||||||
|
|
||||||
File.open @temp_conf, "w" do |fp|
|
File.open @temp_conf, "w" do |fp|
|
||||||
fp.puts ":backtrace: true"
|
fp.puts ":backtrace: false"
|
||||||
fp.puts ":update_sources: false"
|
fp.puts ":update_sources: false"
|
||||||
fp.puts ":bulk_threshold: 10"
|
fp.puts ":bulk_threshold: 10"
|
||||||
fp.puts ":verbose: false"
|
fp.puts ":verbose: false"
|
||||||
@ -300,7 +312,7 @@ if you believe they were disclosed to a third party.
|
|||||||
|
|
||||||
util_config_file args
|
util_config_file args
|
||||||
|
|
||||||
assert_equal false, @cfg.backtrace
|
assert_equal true, @cfg.backtrace
|
||||||
assert_equal true, @cfg.update_sources
|
assert_equal true, @cfg.update_sources
|
||||||
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
|
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold
|
||||||
assert_equal true, @cfg.verbose
|
assert_equal true, @cfg.verbose
|
||||||
@ -386,7 +398,7 @@ if you believe they were disclosed to a third party.
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_write
|
def test_write
|
||||||
@cfg.backtrace = true
|
@cfg.backtrace = false
|
||||||
@cfg.update_sources = false
|
@cfg.update_sources = false
|
||||||
@cfg.bulk_threshold = 10
|
@cfg.bulk_threshold = 10
|
||||||
@cfg.verbose = false
|
@cfg.verbose = false
|
||||||
@ -398,7 +410,7 @@ if you believe they were disclosed to a third party.
|
|||||||
util_config_file
|
util_config_file
|
||||||
|
|
||||||
# These should not be written out to the config file.
|
# These should not be written out to the config file.
|
||||||
assert_equal false, @cfg.backtrace, "backtrace"
|
assert_equal true, @cfg.backtrace, "backtrace"
|
||||||
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold,
|
assert_equal Gem::ConfigFile::DEFAULT_BULK_THRESHOLD, @cfg.bulk_threshold,
|
||||||
"bulk_threshold"
|
"bulk_threshold"
|
||||||
assert_equal true, @cfg.update_sources, "update_sources"
|
assert_equal true, @cfg.update_sources, "update_sources"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user