Module Test::Unit::Assertions
In: lib/test/zentest_assertions.rb

Extra assertions for Test::Unit

Methods

External Aliases

assert_not_equal -> deny_equal
  Alias for assert_not_equal
assert_not_nil -> deny_nil
  Asserts that obj is not nil.

Public Instance methods

Asserts that obj responds to empty? and empty? returns true.

Like assert_in_delta but better dealing with errors proportional to the sizes of a and b.

Asserts that obj responds to include? and that obj includes item.

assert_includes(item, obj, message = nil)

Alias for assert_include

Asserts that boolean is not false or nil.

Asserts that obj responds to empty? and empty? returns false.

Asserts that obj responds to include? and that obj does not include item.

deny_includes(item, obj, message = nil)

Alias for deny_include

Captures $stdout and $stderr to StringIO objects and returns them. Restores $stdout and $stderr when done.

Usage:

  def test_puts
    out, err = capture do
      puts 'hi'
      STDERR.puts 'bye!'
    end
    assert_equal "hi\n", out.string
    assert_equal "bye!\n", err.string
  end

[Validate]