4 |
|
|
5 |
my $debug = @ARGV ? 1 : 0; |
my $debug = @ARGV ? 1 : 0; |
6 |
|
|
7 |
use Test::More tests => 17; |
use Test::More tests => 27; |
8 |
use lib 'lib'; |
use lib 'lib'; |
9 |
|
|
10 |
#use Devel::LeakTrace::Fast; |
#use Devel::LeakTrace::Fast; |
39 |
my $test = { |
my $test = { |
40 |
'Frey' => 0, |
'Frey' => 0, |
41 |
'Frey::Web' => 1, |
'Frey::Web' => 1, |
42 |
|
'Moose' => 0, |
43 |
|
'Fey' => 0, |
44 |
}; |
}; |
45 |
|
|
46 |
foreach my $p ( keys %$test ) { |
foreach my $p ( keys %$test ) { |
48 |
is( $is_role, $test->{$p}, $is_role ? 'role' : 'not role' ); |
is( $is_role, $test->{$p}, $is_role ? 'role' : 'not role' ); |
49 |
diag $meta->dump(2) if $debug; |
diag $meta->dump(2) if $debug; |
50 |
} |
} |
51 |
|
|
52 |
|
my $methods = { |
53 |
|
'Frey' => [], |
54 |
|
'Frey::Editor' => [ 'url_regex', 'command' ], |
55 |
|
}; |
56 |
|
|
57 |
|
foreach my $class ( keys %$methods ) { |
58 |
|
ok( my @m = $o->class_methods($class), "class_methods( $class ) as array" ); |
59 |
|
diag dump( @m ); |
60 |
|
is_deeply( \@m, $methods->{$class}, 'without meta' ); |
61 |
|
foreach my $method ( @{ $methods->{$class} } ) { |
62 |
|
ok( $o->class_methods($class)->{ $method }, "$class has $method" ); |
63 |
|
} |
64 |
|
} |