diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-06-11 17:25:36 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-06-11 17:25:36 +0200 |
commit | 47baab0c415690aeb71ef3bc4831a462d8ead47b (patch) | |
tree | 59942362a34689d0fd4f02bdc9bdb489a82ba880 /activesupport/test | |
parent | cd7cd9b947c75373998b3cb7241753587c4371f3 (diff) | |
parent | f64819524716c14061914584db66ac2a3e1e72b2 (diff) | |
download | rails-47baab0c415690aeb71ef3bc4831a462d8ead47b.tar.gz rails-47baab0c415690aeb71ef3bc4831a462d8ead47b.tar.bz2 rails-47baab0c415690aeb71ef3bc4831a462d8ead47b.zip |
Merge pull request #15628 from akshay-vishnoi/test-cases
Add test cases for #in? and #presence_in
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/core_ext/object/inclusion_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/object/inclusion_test.rb b/activesupport/test/core_ext/object/inclusion_test.rb index b054a8dd31..32d512eca3 100644 --- a/activesupport/test/core_ext/object/inclusion_test.rb +++ b/activesupport/test/core_ext/object/inclusion_test.rb @@ -37,11 +37,14 @@ class InTest < ActiveSupport::TestCase end class C < B end + class D + end def test_in_module assert A.in?(B) assert A.in?(C) assert !A.in?(A) + assert !A.in?(D) end def test_no_method_catching @@ -51,5 +54,6 @@ class InTest < ActiveSupport::TestCase def test_presence_in assert_equal "stuff", "stuff".presence_in(%w( lots of stuff )) assert_nil "stuff".presence_in(%w( lots of crap )) + assert_raise(ArgumentError) { 1.presence_in(1) } end end |