Permalink
Browse files

Merge pull request #12 from ewilhelm/master

reused qmeth
  • Loading branch information...
2 parents de4b5e5 + 8947f01 commit 722a3e1e6a289fafbf85f91166a967688bdfd42f @exodist committed Jan 31, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/Mock/Quick/Method.pm
View
@@ -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 722a3e1

Please sign in to comment.