David Duncan Ross Palmer
and 1 contributors

NAME

Test::Module::Runnable::Base - See Test::Module::Runnable

DESCRIPTION

This is the base class for Test::Module::Runnable, and all user-documentation must be sought there.

A few internal-only methods are documented here for project maintainers.

ATTRIBUTES

sut

See "sut" in Test::Module::Runnable

pattern

See "pattern" in Test::Module::Runnable

logger

See "logger" in Test::Module::Runnable

mocker

See "mocker" in Test::Module::Runnable

PRIVATE ATTRIBUTES

__unique_default_domain

The internal default domain value. This is used when unique is called without a domain, because a key cannot be undef in Perl.

__unique

Tracks the counter returned by unique. Always contains the previous value returned, or zero before any calls. A hash is used to support multiple domains.

__random

Hash of random numbers already given out.

METHODS

unique

See "unique" in Test::Module::Runnable

methodNames

See "methodNames" in Test::Module::Runnable

methodCount

See "methodCount" in Test::Module::Runnable

run

See "run" in Test::Module::Runnable

debug

See "debug" in Test::Module::Runnable

mock($class, $method, $return)

See "mock($class, $method, $return)"

unmock([class], [$method])

See "unmock([class], [$method])" in Test::Module::Runnable

mockCalls($class, $method)

See "mockCalls($class, $method)" in Test::Module::Runnable

mockCallsWithObject($class, $method)

See "mockCallsWithObject($class, $method)" in Test::Module::Runnable

clearMocks

See "clearMocks" in Test::Module::Runnable

USER DEFINED METHODS

setUpBeforeClass

See "setUpBeforeClass" in Test::Module::Runnable

tearDownAfterClass

See "tearDownAfterClass" in Test::Module::Runnable

PROTECTED METHODS

_mockdump

See "_mockdump" in Test::Module::Runnable

PRIVATE METHODS

__mockCalls

Helper method used by "mockCalls($class, $method)" and "mockCallsWithObject($class, $method)".

__generateMethodName

This method returns the current mode of testing the sut as defined in a class derived from Test::Module::Runnable, as a string including the current test method, given to this function.

If the subclass has not defined modeName as a method or attribute, or it is undef, we return the methodName passed, unmodified.

methodName

The name of the method about to be executed. Must be a valid string.

__wrapFail

Called within "run" in order to call "BAIL_OUT" in Test::Builder with an appropriate message - it essentially a way to wrap failures from user-defined methods.

As soon as the user-defined method is called, call this method with the following arguments:

$type

The name of the user-defined method, for example, 'setUp'

$method

The name of the user test method, for example, 'testMyTestMethod'

$fail

The exit code from the user-defined method. Not a boolean. If not EXIT_SUCCESS, BAIL_OUT will be called.

There is no return value.