diff options
author | Yehuda Katz <wycats@gmail.com> | 2011-11-26 18:10:48 -0800 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2011-11-26 18:10:48 -0800 |
commit | 3c81fc3b91ddfd4d115a7001640588eb93249261 (patch) | |
tree | f76041fde5e2dc1e15e5130658a33d32682df8b8 /activesupport/test/core_ext/object/inclusion_test.rb | |
parent | 71b387d91e7d74ad3b90db7b9b9264936d6d3c4d (diff) | |
parent | ebf69ab1636df74c76332c53bcd3d8494fb91b45 (diff) | |
download | rails-3c81fc3b91ddfd4d115a7001640588eb93249261.tar.gz rails-3c81fc3b91ddfd4d115a7001640588eb93249261.tar.bz2 rails-3c81fc3b91ddfd4d115a7001640588eb93249261.zip |
Merge pull request #3767 from tadast/object_in
Object#in? also accepts multiple parameters
Diffstat (limited to 'activesupport/test/core_ext/object/inclusion_test.rb')
-rw-r--r-- | activesupport/test/core_ext/object/inclusion_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/object/inclusion_test.rb b/activesupport/test/core_ext/object/inclusion_test.rb index 1de857d678..568ebe9aab 100644 --- a/activesupport/test/core_ext/object/inclusion_test.rb +++ b/activesupport/test/core_ext/object/inclusion_test.rb @@ -2,6 +2,16 @@ require 'abstract_unit' require 'active_support/core_ext/object/inclusion' class InTest < Test::Unit::TestCase + def test_in_multiple_args + assert :b.in?(:a,:b) + assert !:c.in?(:a,:b) + end + + def test_in_multiple_arrays + assert [1,2].in?([1,2],[2,3]) + assert ![1,2].in?([1,3],[2,1]) + end + def test_in_array assert 1.in?([1,2]) assert !3.in?([1,2]) |