Skip to content

Commit 5e2ed2d

Browse files
authored
test: add test for lambda in exception_level_filters (#1012)
1 parent 71c2736 commit 5e2ed2d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spec/rollbar_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,20 @@
854854
Rollbar.error(exception, :use_exception_level_filters => true)
855855
end
856856

857+
it 'sets error level using lambda' do
858+
Rollbar.configure do |config|
859+
config.exception_level_filters = {
860+
'NameError' => lambda { |error| 'info' }
861+
}
862+
end
863+
864+
logger_mock.should_receive(:info)
865+
logger_mock.should_not_receive(:warn)
866+
logger_mock.should_not_receive(:error)
867+
868+
Rollbar.error(exception, :use_exception_level_filters => true)
869+
end
870+
857871
context 'using :use_exception_level_filters option as false' do
858872
it 'sends the correct filtered level' do
859873
Rollbar.configure do |config|

0 commit comments

Comments
 (0)