1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Added assert_true and assert_false same as test-unit gem

This commit is contained in:
Hiroshi SHIBATA 2022-04-20 14:13:10 +09:00
parent cf73cf5981
commit c506ddac6c
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2

View file

@ -192,6 +192,22 @@ module Test
assert obj.nil?, msg
end
##
# Fails unless +obj+ is true
def assert_true obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to be true" }
assert obj == true, msg
end
##
# Fails unless +obj+ is false
def assert_false obj, msg = nil
msg = message(msg) { "Expected #{mu_pp(obj)} to be false" }
assert obj == false, msg
end
##
# For testing with binary operators.
#