Permalink
Browse files

Modify POD.

  • Loading branch information...
1 parent 30b9bd0 commit 8c4335b37cf6312022b9ac22df56464efc376bee @NetPenguin committed Aug 18, 2013
Showing with 20 additions and 0 deletions.
  1. +20 −0 lib/Test/EasyMock.pm
View
20 lib/Test/EasyMock.pm
@@ -73,6 +73,24 @@ Using C<Test::Deep>'s special comparisons.
$mock->foo({ arg1 => 1, arg2 => 2 }); # return 'a'
verify($mock);
+Mock to class method.
+
+ use Test::EasyMock qw(
+ expect
+ replay
+ verify
+ );
+ use Test::EasyMock::Class qw(
+ create_class_mock
+ );
+
+ my $mock = create_class_mock('Foo::Bar');
+ expect($mock->foo(1))->and_scalar_return('a');
+ replay($mock);
+ Foo::Bar->foo(1); # return 'a'
+ Foo::Bar->foo(2); # Unexpected method call.(A test is failed)
+ verify($mock); # verify all expectations is invoked.
+
=head1 DESCRIPTION
This is mock library modeled on 'EasyMock' in Java.
@@ -236,6 +254,8 @@ modify it under the same terms as Perl itself. See L<perlartistic>.
=over
+=item C<Test::EasyMock::Class>
+
=item EasyMock
L<http://easymock.org/>

0 comments on commit 8c4335b

Please sign in to comment.