4 |
|
|
5 |
my $debug = @ARGV ? 1 : 0; |
my $debug = @ARGV ? 1 : 0; |
6 |
|
|
7 |
use Test::More tests => 8; |
use Test::More tests => 51; |
8 |
use lib 'lib'; |
use lib 'lib'; |
9 |
|
|
10 |
#use Devel::LeakTrace::Fast; |
#use Devel::LeakTrace::Fast; |
11 |
use Data::Dump qw/dump/; |
use Data::Dump qw/dump/; |
12 |
|
|
13 |
BEGIN { |
BEGIN { |
14 |
|
use_ok('Frey::ClassLoader'); |
15 |
use_ok('Frey::Introspect'); |
use_ok('Frey::Introspect'); |
16 |
use_ok('Strix::User'); |
use_ok('Strix::User'); |
17 |
|
use_ok('Frey'); |
18 |
} |
} |
19 |
|
|
20 |
my $package = 'Strix::User'; |
my $f = Frey::ClassLoader->new; |
21 |
|
|
22 |
ok( my $o = Frey::Introspect->new( debug => $debug, package => $package ), 'new' ); |
ok( my $classes = $f->classes, 'classes' ); |
23 |
isa_ok( $o, 'Frey::Introspect' ); |
diag dump( $classes ) if $debug; |
|
diag dump( $o ) if $debug; |
|
24 |
|
|
25 |
ok( $o->meta, 'has meta' ); |
ok( $f->classes, 'classes again' ); |
|
#diag dump( $o->meta ); |
|
|
is( $o->meta->name, 'Frey::Introspect', 'meta->name' ); |
|
26 |
|
|
27 |
ok( defined $o->debug, 'debug' ); |
my $more = 5; |
28 |
|
|
29 |
ok( my $examine = $o->examine, 'examine' ); |
foreach my $package ( $f->classes ) { |
|
diag dump( $examine ) if $debug; |
|
30 |
|
|
31 |
|
ok( my $o = Frey::Introspect->new( debug => $debug, package => $package ), 'new' ); |
32 |
|
isa_ok( $o, 'Frey::Introspect' ); |
33 |
|
diag dump( $o ) if $debug; |
34 |
|
|
35 |
|
ok( $o->meta, 'has meta' ); |
36 |
|
#diag dump( $o->meta ); |
37 |
|
is( $o->meta->name, 'Frey::Introspect', 'meta->name' ); |
38 |
|
|
39 |
|
ok( defined $o->debug, 'debug' ); |
40 |
|
ok( ! $o->path, 'no path' ); |
41 |
|
|
42 |
|
ok( my $js = $o->joose, 'joose' ); |
43 |
|
diag dump( $js ) if $debug; |
44 |
|
|
45 |
|
ok( $o->path, 'path' ); |
46 |
|
|
47 |
|
ok( my @methods = $o->methods, 'methods' ); |
48 |
|
diag dump( @methods ) if $debug; |
49 |
|
|
50 |
|
last unless --$more; |
51 |
|
} |