Browse files

lib/Mock/Quick/Method.pm - allow reused qmeth

  • Loading branch information...
1 parent de4b5e5 commit 8947f01bd6f821bba692044f3240cc1657c52d1b @ewilhelm ewilhelm committed Jan 30, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/Mock/Quick/Method.pm
View
1 lib/Mock/Quick/Method.pm
@@ -7,6 +7,7 @@ use Carp ();
sub new {
my $class = shift;
my ($sub) = @_;
+ return $sub if eval {$sub->isa($class)};
Carp::croak "Constructor to $class takes a single codeblock"
unless ref $sub eq 'CODE';
return bless $sub, $class;

0 comments on commit 8947f01

Please sign in to comment.