diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/test/callbacks_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/callbacks_test.rb b/activesupport/test/callbacks_test.rb index b48145aab7..0a29dd21c8 100644 --- a/activesupport/test/callbacks_test.rb +++ b/activesupport/test/callbacks_test.rb @@ -813,6 +813,18 @@ module CallbacksTest } end + # FIXME: do we really want to support classes as conditionals? There were + # no tests for it previous to this. + def test_class + z = [] + klass = build_class Class.new { + define_singleton_method(:before) { |o| z << o } + } + object = klass.new + object.run + assert_equal [object], z + end + def test_proc_negative_arity # passes an empty list if *args z = [] object = build_class(->(*args) { z << args }).new |