Steven Lee > Test-Magpie > Test::Magpie::Stub

Download:
Test-Magpie-0.11.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.11   Source  

NAME ^

Test::Magpie::Stub - The declaration of a stubbed method

DESCRIPTION ^

Represents a stub method - a method that may have some sort of action when called. Stub methods are created by invoking the method name (with a set of possible argument matchers/arguments) on the object returned by when in Test::Magpie.

Stub methods have a stack of executions. Every time the stub method is called (matching arguments), the next execution is taken from the front of the queue and called. As stubs are matched via arguments, you may have multiple stubs for the same method name.

ATTRIBUTES ^

executions

Internal. An array reference containing all stub executions.

METHODS ^

then_return $return_value

Pushes a stub method that will return $return_value to the end of the execution queue.

then_die $exception

Pushes a stub method that will throw $exception when called to the end of the execution stack.

execute

Internal. Executes the next execution, if possible

AUTHORS ^

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2013 by Oliver Charles.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: