test/configuration_test.rb in airbrake-3.1.2 vs test/configuration_test.rb in airbrake-3.1.3

- old
+ new

@@ -1,6 +1,6 @@ -require File.dirname(__FILE__) + '/helper' +require File.expand_path '../helper', __FILE__ class ConfigurationTest < Test::Unit::TestCase include DefinesConstants @@ -27,12 +27,26 @@ Airbrake::Configuration::DEFAULT_BACKTRACE_FILTERS assert_config_default :ignore, Airbrake::Configuration::IGNORE_DEFAULT assert_config_default :development_lookup, true assert_config_default :framework, 'Standalone' + assert_config_default :async, nil end + should "set GirlFriday-callable for async=true" do + config = Airbrake::Configuration.new + config.async = true + assert config.async.respond_to?(:call) + end + + should "set provided-callable for async {}" do + config = Airbrake::Configuration.new + config.async {|notice| :ok} + assert config.async.respond_to?(:call) + assert_equal :ok, config.async.call + end + should "provide default values for secure connections" do config = Airbrake::Configuration.new config.secure = true assert_equal 443, config.port assert_equal 'https', config.protocol @@ -68,10 +82,11 @@ assert_config_overridable :notifier_name assert_config_overridable :notifier_url assert_config_overridable :environment_name assert_config_overridable :development_lookup assert_config_overridable :logger + assert_config_overridable :async end should "have an api key" do assert_config_overridable :api_key end @@ -82,10 +97,10 @@ [:api_key, :backtrace_filters, :development_environments, :environment_name, :host, :http_open_timeout, :http_read_timeout, :ignore, :ignore_by_filters, :ignore_user_agent, :notifier_name, :notifier_url, :notifier_version, :params_filters, :project_root, :port, :protocol, :proxy_host, :proxy_pass, :proxy_port, - :proxy_user, :secure, :development_lookup].each do |option| + :proxy_user, :secure, :development_lookup, :async].each do |option| assert_equal config[option], hash[option], "Wrong value for #{option}" end end should "be mergable" do