6 use Test::More tests => 9;
23 around qr/bark.*/ => sub {
24 'Dog::around(' . $_[0]->() . ')';
30 is( $dog->bark_once, 'Dog::around(bark)', 'around modifier is called' );
31 is( $dog->bark_twice, 'Dog::around(barkbark)', 'around modifier is called' );
37 our $BEFORE_BARK_COUNTER = 0;
38 our $AFTER_BARK_COUNTER = 0;
49 before qr/bark.*/ => sub {
50 $BEFORE_BARK_COUNTER++;
53 after qr/bark.*/ => sub {
54 $AFTER_BARK_COUNTER++;
61 is( $Cat::BEFORE_BARK_COUNTER, 1, 'before modifier is called once' );
62 is( $Cat::AFTER_BARK_COUNTER, 1, 'after modifier is called once' );
64 is( $Cat::BEFORE_BARK_COUNTER, 2, 'before modifier is called twice' );
65 is( $Cat::AFTER_BARK_COUNTER, 2, 'after modifier is called twice' );
72 before qr/bark.*/ => sub {};
73 } '... this is not currently supported';
76 around qr/bark.*/ => sub {};
77 } '... this is not currently supported';
80 after qr/bark.*/ => sub {};
81 } '... this is not currently supported';