From ebf69ab1636df74c76332c53bcd3d8494fb91b45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadas=20Tamo=C5=A1auskas?= Date: Sat, 26 Nov 2011 23:51:09 +0000 Subject: Object#in? also accepts multiple parameters --- activesupport/test/core_ext/object/inclusion_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'activesupport/test/core_ext/object/inclusion_test.rb') 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]) -- cgit v1.2.3