add assert_not_nil method

This commit is contained in:
takumakume
2019-09-05 19:51:54 +09:00
parent be8bb2be61
commit 6c4278144a
+7
View File
@@ -208,6 +208,13 @@ def assert_nil(obj, msg = nil)
assert_true(ret, msg, diff)
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_not_include(*args); _assert_include(false, *args) end
def _assert_include(affirmed, collection, obj, msg = nil)