Module RUNIT::Assert
In: lib/runit/assert.rb

Methods

Included Modules

Test::Unit::Assertions

Public Instance methods

[Source]

    # 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

[Source]

    # File lib/runit/assert.rb, line 57
57:     def assert_exception(exception, message="", &block)
58:       assert_raises(exception, message, &block)
59:     end

[Source]

    # File lib/runit/assert.rb, line 45
45:     def assert_fail(message="")
46:       flunk(message)
47:     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

[Source]

    # 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

[Source]

    # File lib/runit/assert.rb, line 41
41:     def assert_matches(*args)
42:       assert_match(*args)
43:     end

[Source]

    # File lib/runit/assert.rb, line 15
15:     def assert_no_exception(*args, &block)
16:       assert_nothing_raised(*args, &block)
17:     end

[Source]

    # 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

[Source]

    # File lib/runit/assert.rb, line 33
33:     def assert_not_nil(actual, message="")
34:       assert(!actual.nil?, message)
35:     end

[Source]

    # 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

[Source]

    # File lib/runit/assert.rb, line 53
53:     def assert_send(object, method, *args)
54:       super([object, method, *args])
55:     end

[Source]

    # File lib/runit/assert.rb, line 69
69:     def called_internally?
70:       /assertions\.rb/.match(caller[1])
71:     end

[Source]

    # File lib/runit/assert.rb, line 12
12:     def setup_assert
13:     end

[Validate]