1
# Author:: Nathaniel Talbott.
2
# Copyright:: Copyright (c) 2000-2002 Nathaniel Talbott. All rights reserved.
3
# License:: Ruby license.
5
require 'test/unit/assertions'
14
def assert_no_exception(*args, &block)
15
assert_nothing_raised(*args, &block)
18
# To deal with the fact that RubyUnit does not check that the
19
# regular expression is, indeed, a regular expression, if it is
20
# not, we do our own assertion using the same semantics as
22
def assert_match(actual_string, expected_re, message="")
24
full_message = build_message(message, "Expected <?> to match <?>", actual_string, expected_re)
25
assert_block(full_message) {
26
expected_re =~ actual_string
32
def assert_not_nil(actual, message="")
33
assert(!actual.nil?, message)
36
def assert_not_match(actual_string, expected_re, message="")
37
assert_no_match(expected_re, actual_string, message)
40
def assert_matches(*args)
44
def assert_fail(message="")
48
def assert_equal_float(expected, actual, delta, message="")
49
assert_in_delta(expected, actual, delta, message)
52
def assert_send(object, method, *args)
53
super([object, method, *args])
56
def assert_exception(exception, message="", &block)
57
assert_raises(exception, message, &block)
60
def assert_respond_to(method, object, message="")
61
if (called_internally?)
64
super(object, method, message)
68
def called_internally?
69
/assertions\.rb/.match(caller[1])
73
include Test::Unit::Assertions