6 use Test::More no_plan => 18;
11 use_ok('Class::MOP::Method');
16 my $method = Class::MOP::Method->new(sub { $trace .= 'primary' });
17 isa_ok($method, 'Class::MOP::Method');
20 is($trace, 'primary', '... got the right return value from method');
23 my $wrapped = $method->wrap();
24 isa_ok($wrapped, 'Class::MOP::Method');
27 is($trace, 'primary', '... got the right return value from the wrapped method');
31 $wrapped->add_before_modifier(sub { $trace .= 'before -> ' });
32 } '... added the before modifier okay';
35 is($trace, 'before -> primary', '... got the right return value from the wrapped method (w/ before)');
39 $wrapped->add_after_modifier(sub { $trace .= ' -> after' });
40 } '... added the after modifier okay';
43 is($trace, 'before -> primary -> after', '... got the right return value from the wrapped method (w/ before)');