6 use Test::More tests => 10;
27 around qr/bark.*/ => sub {
28 'Dog::around(' . $_[0]->() . ')';
34 is( $dog->bark_once, 'Dog::around(bark)', 'around modifier is called' );
35 is( $dog->bark_twice, 'Dog::around(barkbark)', 'around modifier is called' );
41 our $BEFORE_BARK_COUNTER = 0;
42 our $AFTER_BARK_COUNTER = 0;
53 before qr/bark.*/ => sub {
54 $BEFORE_BARK_COUNTER++;
57 after qr/bark.*/ => sub {
58 $AFTER_BARK_COUNTER++;
65 is( $Cat::BEFORE_BARK_COUNTER, 1, 'before modifier is called once' );
66 is( $Cat::AFTER_BARK_COUNTER, 1, 'after modifier is called once' );
68 is( $Cat::BEFORE_BARK_COUNTER, 2, 'before modifier is called twice' );
69 is( $Cat::AFTER_BARK_COUNTER, 2, 'after modifier is called twice' );
76 before qr/bark.*/ => sub {};
77 } '... this is not currently supported';
80 around qr/bark.*/ => sub {};
81 } '... this is not currently supported';
84 after qr/bark.*/ => sub {};
85 } '... this is not currently supported';