Module | RUNIT::Assert |
In: |
lib/runit/assert.rb
|
# File lib/runit/assert.rb, line 49 49: def assert_equal_float(expected, actual, delta, message="") 50: assert_in_delta(expected, actual, delta, message) 51: end
# File lib/runit/assert.rb, line 57 57: def assert_exception(exception, message="", &block) 58: assert_raises(exception, message, &block) 59: end
To deal with the fact that RubyUnit does not check that the regular expression is, indeed, a regular expression, if it is not, we do our own assertion using the same semantics as RubyUnit
# File lib/runit/assert.rb, line 23 23: def assert_match(actual_string, expected_re, message="") 24: _wrap_assertion { 25: full_message = build_message(message, "Expected <?> to match <?>", actual_string, expected_re) 26: assert_block(full_message) { 27: expected_re =~ actual_string 28: } 29: Regexp.last_match 30: } 31: end
# File lib/runit/assert.rb, line 15 15: def assert_no_exception(*args, &block) 16: assert_nothing_raised(*args, &block) 17: end
# File lib/runit/assert.rb, line 37 37: def assert_not_match(actual_string, expected_re, message="") 38: assert_no_match(expected_re, actual_string, message) 39: end
# File lib/runit/assert.rb, line 33 33: def assert_not_nil(actual, message="") 34: assert(!actual.nil?, message) 35: end
# File lib/runit/assert.rb, line 61 61: def assert_respond_to(method, object, message="") 62: if (called_internally?) 63: super 64: else 65: super(object, method, message) 66: end 67: end
# File lib/runit/assert.rb, line 53 53: def assert_send(object, method, *args) 54: super([object, method, *args]) 55: end