Kalle Hallivuori > Test-CallFlow > Test::CallFlow::Plan

Download:
Test-CallFlow-0.03.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  7
Open  0
View/Report Bugs
Source  

Test::CallFlow::Plan ^

Contains planned calls to mocked functions.

METHODS ^

new

  my $mock_call_plan = Test::CallFlow::Plan->new( %properties );

add_call

  $mock_call_plan->add_call( Test::CallFlow::Call->new( 'subname', @args ) );

Adds a call into this plan.

call

  $mock_call_plan->call( 'subname', @args );

Heart of plan execution. Searches for a matching call and returns the result.

This should be shortened for ease of further development. Then again, it seems to work.

failed_call

  $mock_call_plan->failed_call( $called, $calls, \@errors );

Used by call() to report errors. Croaks with a list of tried and failed call proposals.

unsatisfied

Returns an array of remaining unsatisfied calls.

Whole plan can be seen as successfully executed once this returns an empty array.

reset

  $plan->reset;

Return to planning state, preserving all previously made plans and discarding any results of running.

list_calls

Returns the list of calls in this plan.

syntax highlighting: