Permalink
Browse files

Add test cases for #in? and #presence_in

  • Loading branch information...
1 parent 3681e1a commit f64819524716c14061914584db66ac2a3e1e72b2 Akshay Vishnoi committed Jun 11, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 activesupport/test/core_ext/object/inclusion_test.rb
@@ -37,11 +37,14 @@ class B
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 @@ def test_no_method_catching
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

0 comments on commit f648195

Please sign in to comment.