Class

Test::Unit::TestCase

Inheritance
< Object
Included Modules
Assertions, Util::BacktraceFilter

Ties everything together. If you subclass and add your own test methods, it takes care of making them into tests and wrapping those tests into a suite. It also does the nitty-gritty of actually running an individual test and collecting its results into a Test::Unit::TestResult object.

Constants

Name   Description
FINISHED = name + "::FINISHED"
PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt, SystemExit] These exceptions are not caught by run.
STARTED = name + "::STARTED"

Attributes

Name Visibility R/W Description
method_name public R

Methods

Class

Visibility Signature
public new (test_method_name)
public suite ()

Instance

Visibility Signature
public == (other)
public default_test ()
public name ()
public run (result) {|STARTED, name| ...}
public setup ()
public size ()
public teardown ()
public to_s ()

Class Method Detail

new(test_method_name)

Creates a new instance of the fixture for running the test represented by test_method_name.

suite()

Rolls up all of the test* methods in the fixture into one suite, creating a new instance of the fixture for each method.

Instance Method Detail

==(other)

It‘s handy to be able to compare TestCase instances.

default_test()

name()

Returns a human-readable name for the specific test that this instance of TestCase represents.

run(result) {|STARTED, name| ...}

Runs the individual test method represented by this instance of the fixture, collecting statistics, failures and errors in result.

setup()

Called before every test method runs. Can be used to set up fixture information.

size()

teardown()

Called after every test method runs. Can be used to tear down fixture information.

to_s()

Overridden to return name.