test/configuration_test.rb in hydraulic_brake-0.1.0 vs test/configuration_test.rb in hydraulic_brake-0.2.0
- old
+ new
@@ -3,24 +3,25 @@
class ConfigurationTest < Test::Unit::TestCase
include DefinesConstants
should "provide default values" do
- assert_config_default :proxy_host, nil
- assert_config_default :proxy_port, nil
- assert_config_default :proxy_user, nil
- assert_config_default :proxy_pass, nil
- assert_config_default :project_root, nil
- assert_config_default :environment_name, nil
- assert_config_default :logger, nil
- assert_config_default :notifier_version, HydraulicBrake::VERSION
- assert_config_default :notifier_name, 'HydraulicBrake Notifier'
- assert_config_default :notifier_url, 'https://github.com/stevecrozz/hydraulic_brake'
- assert_config_default :secure, false
- assert_config_default :host, 'api.airbrake.io'
- assert_config_default :http_open_timeout, 2
- assert_config_default :http_read_timeout, 5
+ assert_config_default :async, false
+ assert_config_default :async_queue_capacity, 100
+ assert_config_default :proxy_host, nil
+ assert_config_default :proxy_port, nil
+ assert_config_default :proxy_user, nil
+ assert_config_default :proxy_pass, nil
+ assert_config_default :project_root, nil
+ assert_config_default :environment_name, nil
+ assert_config_default :notifier_version, HydraulicBrake::VERSION
+ assert_config_default :notifier_name, 'HydraulicBrake Notifier'
+ assert_config_default :notifier_url, 'https://github.com/stevecrozz/hydraulic_brake'
+ assert_config_default :secure, false
+ assert_config_default :host, 'api.airbrake.io'
+ assert_config_default :http_open_timeout, 2
+ assert_config_default :http_read_timeout, 5
assert_config_default :params_filters,
HydraulicBrake::Configuration::DEFAULT_PARAMS_FILTERS
assert_config_default :backtrace_filters,
HydraulicBrake::Configuration::DEFAULT_BACKTRACE_FILTERS
assert_config_default :rake_environment_filters, []
@@ -49,10 +50,12 @@
config.secure = true
assert_equal 443, config.port
end
should "allow values to be overwritten" do
+ assert_config_overridable :async
+ assert_config_overridable :async_queue_capacity
assert_config_overridable :proxy_host
assert_config_overridable :proxy_port
assert_config_overridable :proxy_user
assert_config_overridable :proxy_pass
assert_config_overridable :secure
@@ -108,11 +111,11 @@
end
end
should "use development and test as development environments by default" do
config = HydraulicBrake::Configuration.new
- assert_same_elements %w(development test cucumber), config.development_environments
+ assert_same_elements %w(development test), config.development_environments
end
should "be public in a public environment" do
config = HydraulicBrake::Configuration.new
config.development_environments = %w(development)
@@ -128,9 +131,14 @@
end
should "be public without an environment name" do
config = HydraulicBrake::Configuration.new
assert config.public?
+ end
+
+ should "use the default logger none is set" do
+ config = HydraulicBrake::Configuration.new
+ assert_kind_of Logger, config.logger
end
should "use the assigned logger if set" do
config = HydraulicBrake::Configuration.new
config.logger = "CUSTOM LOGGER"