diff options
author | Tadas Tamošauskas <tadastoo@yahoo.com> | 2011-11-26 23:51:09 +0000 |
---|---|---|
committer | Tadas Tamošauskas <tadastoo@yahoo.com> | 2011-11-26 23:51:09 +0000 |
commit | ebf69ab1636df74c76332c53bcd3d8494fb91b45 (patch) | |
tree | 6c6248d4871af14bb5adcc7447d589de4cf0d14b /activesupport/test/core_ext/object | |
parent | 4cdd44e3e0e22742a6e0ddc67c388cee0c8c13db (diff) | |
download | rails-ebf69ab1636df74c76332c53bcd3d8494fb91b45.tar.gz rails-ebf69ab1636df74c76332c53bcd3d8494fb91b45.tar.bz2 rails-ebf69ab1636df74c76332c53bcd3d8494fb91b45.zip |
Object#in? also accepts multiple parameters
Diffstat (limited to 'activesupport/test/core_ext/object')
-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]) |