diff options
Diffstat (limited to 'activesupport/test/callbacks_test.rb')
-rw-r--r-- | activesupport/test/callbacks_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/activesupport/test/callbacks_test.rb b/activesupport/test/callbacks_test.rb index 2b4adda4d1..e723121bb4 100644 --- a/activesupport/test/callbacks_test.rb +++ b/activesupport/test/callbacks_test.rb @@ -461,7 +461,7 @@ module CallbacksTest set_callback :save, :after, :third - attr_reader :history, :saved + attr_reader :history, :saved, :halted def initialize @history = [] end @@ -490,6 +490,10 @@ module CallbacksTest @saved = true end end + + def halted_callback_hook(filter) + @halted = filter + end end class CallbackObject @@ -595,6 +599,12 @@ module CallbacksTest assert_equal ["first", "second", "third", "second", "first"], terminator.history end + def test_termination_invokes_hook + terminator = CallbackTerminator.new + terminator.save + assert_equal ":second", terminator.halted + end + def test_block_never_called_if_terminated obj = CallbackTerminator.new obj.save |