diff --git a/spec/fail_middleware_spec.rb b/spec/fail_middleware_spec.rb index 410c170..c93c2af 100644 --- a/spec/fail_middleware_spec.rb +++ b/spec/fail_middleware_spec.rb @@ -2,7 +2,10 @@ describe Failurous::Rails::FailMiddleware do before(:all) do - Failurous::Rails.configure(false) { } + Failurous::Rails.configure(false) do |config| + config.ignore_exceptions << ArgumentError + end + @app = MockApp.new @middleware = Failurous::Rails::FailMiddleware.new(@app) end @@ -16,6 +19,15 @@ Failurous.should_receive(:notify).with(error, kontroller) lambda { @middleware.call(env) }.should raise_error(StandardError) end + + it "should not notify of ignored errors, but raise them to upper levels" do + error = ArgumentError.new + kontroller = mock() + @app.should_receive(:call).once().and_raise(error) + + Failurous.should_not_receive(:notify) + lambda { @middleware.call({}) }.should raise_error(ArgumentError) + end end class MockApp