Unverified Commit 968547d7 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #4690 from takumakume/add_assert_not_nil

Add `assert_not_nil` method
parents be8bb2be 6c427814
...@@ -208,6 +208,13 @@ def assert_nil(obj, msg = nil) ...@@ -208,6 +208,13 @@ def assert_nil(obj, msg = nil)
assert_true(ret, msg, diff) assert_true(ret, msg, diff)
end end
def assert_not_nil(obj, msg = nil)
if ret = obj.nil?
diff = " Expected #{obj.inspect} to not be nil."
end
assert_false(ret, msg, diff)
end
def assert_include(*args); _assert_include(true, *args) end def assert_include(*args); _assert_include(true, *args) end
def assert_not_include(*args); _assert_include(false, *args) end def assert_not_include(*args); _assert_include(false, *args) end
def _assert_include(affirmed, collection, obj, msg = nil) def _assert_include(affirmed, collection, obj, msg = nil)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment