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:
parent
cf73cf5981
commit
c506ddac6c
1 changed files with 16 additions and 0 deletions
|
@ -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.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue