Add assert_not_include to test environment

This commit is contained in:
Daniel Bovensiepen
2013-06-09 05:16:10 +08:00
parent 29414e8178
commit 5915874e01
+7
View File
@@ -124,6 +124,13 @@ def assert_include(collection, obj, msg = nil)
assert_true(collection.include?(obj), msg, diff)
end
def assert_not_include(collection, obj, msg = nil)
msg = "Expected #{collection.inspect} to not include #{obj.inspect}" unless msg
diff = " Collection: #{collection.inspect}\n" +
" Object: #{obj.inspect}"
assert_false(collection.include?(obj), msg, diff)
end
def assert_raise(*exp)
ret = true
if $mrbtest_assert