mirror of
https://github.com/jimeh/airbrake-statsd.git
synced 2026-02-19 02:46:43 +00:00
hook into Airbreak#notify_or_ignore
This commit is contained in:
@@ -8,8 +8,12 @@ describe Airbrake do
|
||||
subject.method(:notify).should == subject.method(:notify_with_statds)
|
||||
end
|
||||
|
||||
describe '#notify_without_statsd' do
|
||||
it '#notify_or_ignore is an alias to #notify_or_ignore_with_statsd' do
|
||||
subject.method(:notify_or_ignore).
|
||||
should == subject.method(:notify_or_ignore_with_statsd)
|
||||
end
|
||||
|
||||
describe '#notify_without_statsd' do
|
||||
it 'does not call Airbrake::Statsd.increment' do
|
||||
Airbrake.stub(:send_notice).and_return(nil)
|
||||
|
||||
@@ -31,4 +35,28 @@ describe Airbrake do
|
||||
end
|
||||
end
|
||||
|
||||
describe '#notify_or_ignore_without_statsd' do
|
||||
it 'does not call Airbrake::Statsd.increment' do
|
||||
Airbrake.stub(:send_notice).and_return(nil)
|
||||
|
||||
Airbrake.should_receive(:build_notice_for).with('oops', {}).
|
||||
and_return(mock('Notice', :ignore? => false))
|
||||
Airbrake::Statsd.should_not_receive(:increment)
|
||||
|
||||
Airbrake.notify_or_ignore_without_statsd('oops', {})
|
||||
end
|
||||
end
|
||||
|
||||
describe '#notify_or_ignore' do
|
||||
it 'calls Airbrake::Statsd.increment' do
|
||||
Airbrake.stub(:send_notice).and_return(nil)
|
||||
|
||||
Airbrake.should_receive(:build_notice_for).with('oops', {}).
|
||||
and_return(mock('Notice', :ignore? => false))
|
||||
Airbrake::Statsd.should_receive(:increment)
|
||||
|
||||
Airbrake.notify_or_ignore('oops', {})
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user