summaryrefslogtreecommitdiff
path: root/tool/lib/test/unit/assertions.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/lib/test/unit/assertions.rb')
-rw-r--r--tool/lib/test/unit/assertions.rb42
1 files changed, 19 insertions, 23 deletions
diff --git a/tool/lib/test/unit/assertions.rb b/tool/lib/test/unit/assertions.rb
index 065a7a0a46..b4f1dbc176 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
@@ -345,20 +361,6 @@ module Test
end
##
- # Returns details for exception +e+
-
- def exception_details e, msg
- [
- "#{msg}",
- "Class: <#{e.class}>",
- "Message: <#{e.message.inspect}>",
- "---Backtrace---",
- "#{Test::filter_backtrace(e.backtrace).join("\n")}",
- "---------------",
- ].join "\n"
- end
-
- ##
# Fails with +msg+
def flunk msg = nil
@@ -527,11 +529,9 @@ module Test
end
alias omit pend
- # TODO: Removed this and enabled to raise NoMethodError with skip
- alias skip pend
- # def skip(msg = nil, bt = caller)
- # raise NoMethodError, "use omit or pend", caller
- # end
+ def skip(msg = nil, bt = caller)
+ raise NoMethodError, "use omit or pend", caller
+ end
##
# Was this testcase skipped? Meant for #teardown.
@@ -563,10 +563,6 @@ module Test
assert yield, *msgs
end
- def assert_raises(*exp, &b)
- raise NoMethodError, "use assert_raise", caller
- end
-
# :call-seq:
# assert_nothing_thrown( failure_message = nil, &block )
#