Commit | Line | Data |
4c8c3908 |
1 | #!/usr/bin/perl |
2 | use strict; |
3 | use warnings; |
4 | use English; |
5 | |
6 | use Test::More tests => 6; |
7 | |
8 | # test role and class |
9 | package SomeRole; |
10 | use Moose::Role; |
11 | |
12 | requires 'foo'; |
13 | |
14 | package SomeClass; |
15 | use Moose; |
16 | has 'foo' => (is => 'rw'); |
17 | with 'SomeRole'; |
18 | |
19 | package main; |
20 | |
21 | #my $c = SomeClass->new; |
22 | #isa_ok( $c, 'SomeClass'); |
23 | |
24 | for my $modifier_type (qw[ before around after ]) { |
25 | my $get_func = "get_${modifier_type}_method_modifiers"; |
26 | my @mms = eval{ SomeRole->meta->$get_func('foo') }; |
27 | is($@, '', "$get_func for no method mods does not die"); |
28 | is(scalar(@mms),0,'is an empty list'); |
29 | } |