diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-04-20 14:13:10 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2022-04-20 14:13:10 +0900 |
commit | c506ddac6c88b14daf4a18bddf1c1e57be8d2225 (patch) | |
tree | 4d29eeb973540ae96953350c4ee4e8d0cda39cfe /tool/lib | |
parent | cf73cf5981802f2bcc30aba07914acf4286cda5a (diff) | |
download | ruby-c506ddac6c88b14daf4a18bddf1c1e57be8d2225.tar.gz |
Added assert_true and assert_false same as test-unit gem
Diffstat (limited to 'tool/lib')
-rw-r--r-- | tool/lib/test/unit/assertions.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb index 6345a625c1..3244913a36 100644 --- a/tool/lib/test/unit/assertions.rb +++ b/tool/lib/test/unit/assertions.rb @@ -193,6 +193,22 @@ module Test 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. # # assert_operator 5, :<=, 4 |