Skip to content

Commit

Permalink
Fix Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ka2u committed Sep 8, 2013
1 parent ae613c3 commit 98b5488
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
24 changes: 23 additions & 1 deletion README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,14 @@ Test::Double - Perl extension for Test Double.
is $foo->bar, 'BAR', 'stubbed bar() returns "BAR"';

# mock out
mock($foo)->expects('bar')->returns('BAR');
mock($foo)->expects('bar')->at_most(2)->returns('BAR');
is $foo->bar, 'BAR', 'mocked bar() returns "BAR"';

my $result = Test::Double->verify_result;
ok $result->{bar}->{at_most};

Test::Double->verify;
Test::Double->reset;

done_testing;

Expand Down Expand Up @@ -57,6 +63,22 @@ by calling expects() method.

See L<Test::Double::Mock>

=item verify

Verify how many times method calling, and method calling with what args.

=item verify_result

Returns verified result.

my $result = Test::Double->verify_result;
$result->{some_method}->{at_least};
# result->{what method}->{what expectation}

=item reset

Reset mocking objects.

=back

=head1 AUTHOR
Expand Down
4 changes: 2 additions & 2 deletions lib/Test/Double.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Test::Double - Perl extension for Test Double.
is $foo->bar, 'BAR', 'mocked bar() returns "BAR"';
my $result = Test::Double->verify_result;
ok $result->[0]->{bar}->{at_most};
ok $result->{bar}->{at_most};
Test::Double->verify;
Test::Double->reset;
Expand Down Expand Up @@ -104,7 +104,7 @@ See L<Test::Double::Mock>
=item verify
Verify how many times method calling, and method calling with what args .
Verify how many times method calling, and method calling with what args.
=item verify_result
Expand Down

0 comments on commit 98b5488

Please sign in to comment.