Sorry this isn't a pull request - for some reason my fork isn't playing ball. I may need to wipe it and refork. In the mean time, a passing test case for you...
use strict;
use warnings;
use Test::More;
use mop;
my $x;
BEGIN { $x = 1 };
class Foo {
method inc { ++$x }
method dec { --$x }
}
my $foo = Foo->new;
is($x, 1);
is($foo->inc, 2);
is($foo->inc, 3);
is($x, 3);
is($foo->dec, 2);
is($foo->dec, 1);
is($x, 1);
done_testing;
Sorry this isn't a pull request - for some reason my fork isn't playing ball. I may need to wipe it and refork. In the mean time, a passing test case for you...