From a007800a552a9ab31c21134c2e716222268a1276 Mon Sep 17 00:00:00 2001 From: stopdropandrew Date: Sat, 2 Mar 2013 15:50:41 -0800 Subject: ActiveSupport::Notifications::Instrumenter#instrument should yield its payload the same way that ActiveSupport::Notifications does. Fix spelling in test name. --- activesupport/test/notifications/instrumenter_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport/test/notifications/instrumenter_test.rb') diff --git a/activesupport/test/notifications/instrumenter_test.rb b/activesupport/test/notifications/instrumenter_test.rb index 62a9b61464..f46e96f636 100644 --- a/activesupport/test/notifications/instrumenter_test.rb +++ b/activesupport/test/notifications/instrumenter_test.rb @@ -34,6 +34,14 @@ module ActiveSupport assert called end + def test_instrument_yields_the_payload_for_further_modification + assert_equal 2, instrumenter.instrument("awesome") { |p| p[:result] = 1 + 1 } + assert_equal 1, notifier.finishes.size + name, _, payload = notifier.finishes.first + assert_equal "awesome", name + assert_equal Hash[:result => 2], payload + end + def test_start instrumenter.start("foo", payload) assert_equal [["foo", instrumenter.id, payload]], notifier.starts -- cgit v1.2.3