提交 f6481952 编写于 作者: A Akshay Vishnoi

Add test cases for #in? and #presence_in

上级 3681e1ac
......@@ -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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册