features/support/rake/Rakefile in airbrake-3.1.12 vs features/support/rake/Rakefile in airbrake-3.1.13
- old
+ new
@@ -3,11 +3,14 @@
require 'rake'
require 'rubygems'
require 'airbrake'
require 'airbrake/rake_handler'
+class IgnoredException < StandardError; end
+
Airbrake.configure do |c|
+ c.ignore_rake_only = ["IgnoredException"]
end
# Should catch exception
task :airbrake do
Airbrake.configuration.rescue_rake_exceptions = true
@@ -20,10 +23,17 @@
Airbrake.configuration.rescue_rake_exceptions = false
stub_tty_output(true)
raise_exception
end
+# Should ignore the exception
+task :airbrake_ignored do
+ Airbrake.configuration.rescue_rake_exceptions = true
+ stub_tty_output(true)
+ raise_exception(IgnoredException)
+end
+
# Should not catch exception as tty_output is true
task :airbrake_autodetect_from_terminal do
Airbrake.configuration.rescue_rake_exceptions = nil
stub_tty_output(true)
raise_exception
@@ -42,12 +52,12 @@
stub_empty_sender
raise_exception
end
module Airbrake
- def self.notify_or_ignore(*args)
- $stderr.puts "[airbrake] #{args[1][:component]}"
+ def self.send_notice(notice)
+ $stderr.puts "[airbrake] #{notice.component}"
end
end
def stub_empty_sender
Airbrake.sender = nil
@@ -60,8 +70,8 @@
@tty_output_stub
end
end
end
-def raise_exception
- raise 'TEST'
+def raise_exception(exception_class = StandardError)
+ raise exception_class.new('TEST')
end