Permalink
Browse files

Fix bug where params dissapear from overriden class subs

  • Loading branch information...
1 parent 522c328 commit 1341d3751538991695338236e17781647da619f3 @exodist committed Apr 14, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/Mock/Quick.pm
  2. +1 −1 lib/Mock/Quick/Class.pm
View
@@ -8,7 +8,7 @@ use Mock::Quick::Object::Control;
use Mock::Quick::Method;
use Mock::Quick::Util;
-our $VERSION = '1.100';
+our $VERSION = '1.101';
default_export qclass => sub { Mock::Quick::Class->new( @_ ) };
default_export qtakeover => sub { Mock::Quick::Class->takeover( @_ ) };
View
@@ -165,7 +165,7 @@ sub override {
my $orig_value = $pairs{$name};
my $real_value = _is_sub_ref( $orig_value )
- ? sub { $metrics->{$name}++; return $orig_value->() }
+ ? sub { $metrics->{$name}++; goto &$orig_value }
: sub { $metrics->{$name}++; return $orig_value };
my $original = $package->can( $name );

0 comments on commit 1341d37

Please sign in to comment.