From cd233dd87e6f0f9113a397531d37075cfa7c6526 Mon Sep 17 00:00:00 2001 From: Jared McFarland Date: Fri, 15 Apr 2011 00:04:21 +0800 Subject: Only rescue a thrown NoMethodError, don't preemptively check for #include?; added tests --- activesupport/test/core_ext/object/inclusion_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activesupport/test/core_ext') diff --git a/activesupport/test/core_ext/object/inclusion_test.rb b/activesupport/test/core_ext/object/inclusion_test.rb index 382271d42d..1de857d678 100644 --- a/activesupport/test/core_ext/object/inclusion_test.rb +++ b/activesupport/test/core_ext/object/inclusion_test.rb @@ -43,4 +43,8 @@ class InTest < Test::Unit::TestCase assert A.in?(C) assert !A.in?(A) end + + def test_no_method_catching + assert_raise(ArgumentError) { 1.in?(1) } + end end -- cgit v1.2.3