aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-15 11:01:37 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-15 12:24:31 +0100
commit7f4d8e3fbd704cf1005a46309e3795192b114013 (patch)
tree39b65d628b46cc849086470c614b66351141cd0d /activesupport/test
parentb0994be5bd24559f1362a636b46271de6d6a92d6 (diff)
downloadrails-7f4d8e3fbd704cf1005a46309e3795192b114013.tar.gz
rails-7f4d8e3fbd704cf1005a46309e3795192b114013.tar.bz2
rails-7f4d8e3fbd704cf1005a46309e3795192b114013.zip
Yield the payload notifications for further modification (like adding the result).
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/notifications_test.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/test/notifications_test.rb b/activesupport/test/notifications_test.rb
index 3690d723fa..c3eb1a4eb5 100644
--- a/activesupport/test/notifications_test.rb
+++ b/activesupport/test/notifications_test.rb
@@ -90,8 +90,8 @@ module Notifications
drain
end
- def test_instrument_with_band_adds_result_to_payload
- assert_equal 2, instrument!(:awesome) { 1 + 1 }
+ def test_instrument_yields_the_paylod_for_further_modification
+ assert_equal 2, instrument(:awesome) { |p| p[:result] = 1 + 1 }
drain
assert_equal 1, @events.size