Test::Mini::TestCase - Base class for Test::Mini test cases
new($class, %args)
Constructor.
Parameters:
(Hash) %args -- Initial state for the new instance.
%args
Valid Options for %args:
name -- The specific test this instance should run.
run
Runs the test specified at construction time. This method is responsible for invoking the setup and teardown advice for the method, in addition to ensuring that any fatal errors encountered by the program are suitably handled. Appropriate diagnostic information should be sent to the supplied $runner.
$runner
(Test::Mini::Runner) $runner
Returns:
The number of assertions called by this test.
setup($self)
Test setup behavior, automatically invoked prior to each test. Intended to be overridden by subclasses.
Examples:
package TestSomething; use base 'Test::Mini::TestCase'; use Something; sub setup { $obj = Something->new(); } sub test_can_foo { assert_can($obj, 'foo'); }
See Also:
#teardown
teardown($self)
Test teardown behavior, automatically invoked following each test. Intended to be overridden by subclasses.
package Test; use base 'Test::Mini::TestCase'; sub teardown { unlink 'foo.bar' } sub test_touching_files { `touch foo.bar`; assert(-f 'foo.bar'); }
#setup
To install Test::Mini, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Mini
CPAN shell
perl -MCPAN -e shell install Test::Mini
For more information on module installation, please visit the detailed CPAN module installation guide.