aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/notifications_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-12 13:07:04 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-13 01:19:22 +0100
commit4704af763f47362135b644302b8666e36a58fb34 (patch)
tree9f045a9bc1974c6e73f2e5e11811d4e00c69b101 /activesupport/test/notifications_test.rb
parent1e12dc04cbd819f90eb6be5d3192784ee64cb811 (diff)
downloadrails-4704af763f47362135b644302b8666e36a58fb34.tar.gz
rails-4704af763f47362135b644302b8666e36a58fb34.tar.bz2
rails-4704af763f47362135b644302b8666e36a58fb34.zip
Do not send notifications when instrumentation raise an error.
Diffstat (limited to 'activesupport/test/notifications_test.rb')
-rw-r--r--activesupport/test/notifications_test.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index 62849c3d04..226e12ff75 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -113,20 +113,17 @@ module Notifications
assert_equal Hash[:payload => "notifications"], @events.last.payload
end
- def test_instrument_publishes_when_exception_is_raised
+ def test_instrument_does_not_publish_when_exception_is_raised
begin
instrument(:awesome, :payload => "notifications") do
raise "OMG"
end
- flunk
- rescue
+ rescue RuntimeError => e
+ assert_equal "OMG", e.message
end
drain
-
- assert_equal 1, @events.size
- assert_equal :awesome, @events.last.name
- assert_equal Hash[:payload => "notifications"], @events.last.payload
+ assert_equal 0, @events.size
end
def test_event_is_pushed_even_without_block