diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-08 15:23:39 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-05-08 15:23:39 -0700 |
commit | 7d89a9f00a55f545cf027d1d81c22eb3e9eab6d0 (patch) | |
tree | e1bc71f8524b40feb07f4ae281f1a2359e18a15c /activesupport | |
parent | ece76f3840fb0327e58f91d6091beb66801deaed (diff) | |
download | rails-7d89a9f00a55f545cf027d1d81c22eb3e9eab6d0.tar.gz rails-7d89a9f00a55f545cf027d1d81c22eb3e9eab6d0.tar.bz2 rails-7d89a9f00a55f545cf027d1d81c22eb3e9eab6d0.zip |
adding a class conditional test
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 |