diff --git a/spec/lib/resque_job_logging_spec.rb b/spec/lib/resque_job_logging_spec.rb index a69f4fdcfe8c4cb36f62332234de5b5aff1b3378..16d12cd41fd8c3fe95e1baee43189b62a08d9625 100644 --- a/spec/lib/resque_job_logging_spec.rb +++ b/spec/lib/resque_job_logging_spec.rb @@ -25,18 +25,19 @@ describe ResqueJobLogging do end it 'logs stack traces on failure' do Rails.logger.should_receive(:info).with(/app_backtrace=/) + error = RuntimeError.new("GRAAAAAAAAAGH") proc { - ResqueJobLoggingDummy.around_perform_log_job("stuff"){raise "GRAAAAAAAAAGH"} - }.should raise_error + ResqueJobLoggingDummy.around_perform_log_job("stuff"){raise error} + }.should raise_error(Regexp.new(error.message)) end it 'notifies hoptoad if the hoptoad api key is set' do Rails.logger.should_receive(:info) AppConfig.should_receive(:[]).with(:hoptoad_api_key).and_return("what") error = RuntimeError.new("GRAAAAAAAAAGH") - ResqueJobLoggingDummy.should_receive(:notify_hoptoad).with(error, ["stuff"], anything) + ResqueJobLoggingDummy.should_receive(:notify_hoptoad).with(error, ["stuff"]) proc { ResqueJobLoggingDummy.around_perform_log_job("stuff"){raise error } - }.should raise_error + }.should raise_error(Regexp.new(error.message)) end end