Permalink
Browse files

Add testcase.

  • Loading branch information...
1 parent 19678cc commit 566abd4a122318c83df276e6359ac73ef8af3d55 @NetPenguin committed Oct 2, 2013
Showing with 54 additions and 0 deletions.
  1. +27 −0 t/07.uninvoked_method.t
  2. +27 −0 t/99.error.t
View
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+
+use t::Util qw(expect_fail);
+use Test::More;
+BEGIN {
+ use_ok('Test::EasyMock',
+ qw{
+ create_mock
+ expect
+ replay
+ verify
+ });
+}
+use Test::Exception;
+
+# ----
+# Tests.
+subtest 'expected but not invoke' => sub {
+ my $mock = create_mock();
+ expect($mock->foo);
+ replay($mock);
+ expect_fail { verify($mock) };
+};
+
+# ----
+done_testing;
View
@@ -0,0 +1,27 @@
+use strict;
+use warnings;
+
+use Test::More;
+BEGIN {
+ use_ok('Test::EasyMock',
+ qw{
+ expect
+ replay
+ reset
+ verify
+ });
+}
+use Test::Exception;
+
+# ----
+# Tests.
+subtest 'is not a mock object.' => sub {
+ my $other = bless {}, '__DUMMY__';
+ dies_ok { expect($other) } 'expect';
+ dies_ok { replay($other) } 'replay';
+ dies_ok { reset($other) } 'reset';
+ dies_ok { verify($other) } 'verify';
+};
+
+# ----
+done_testing;

0 comments on commit 566abd4

Please sign in to comment.