Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
use Test::More;
use Test::Mock::Guard qw(mock_guard);
{
package Some::Class;
sub new { bless {} => shift }
sub foo { "foo" }
};
my $o = Some::Class->new;
is $o->foo, 'foo';
{
my $g1 = mock_guard('Some::Class' => +{ foo => sub { 'xxx' } });
is $o->foo, 'xxx';
my $g2 = mock_guard('Some::Class' => +{ foo => sub { 'yyy' } });
is $o->foo, 'yyy';
undef $g2;
};
is $o->foo, 'foo';
done_testing;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.