--- trunk/t/02-frey-introspect.t 2008/07/03 19:51:18 51 +++ trunk/t/02-frey-introspect.t 2008/11/20 11:13:43 472 @@ -4,21 +4,32 @@ my $debug = @ARGV ? 1 : 0; -use Test::More tests => 21; +use Test::More tests => 35; use lib 'lib'; #use Devel::LeakTrace::Fast; use Data::Dump qw/dump/; BEGIN { + use_ok('Frey::ClassLoader'); use_ok('Frey::Introspect'); - use_ok('Strix::User'); use_ok('Frey'); } -foreach my $package ( 'Strix::User', 'Frey' ) { +my $f = Frey::ClassLoader->new; - ok( my $o = Frey::Introspect->new( debug => $debug, package => $package ), 'new' ); +ok( my $classes = $f->classes, 'classes' ); +diag dump( $classes ) if $debug; + +ok( $f->classes, 'classes again' ); + +my $more = 5; + +foreach my $class ( $f->classes ) { + + diag $class; + + ok( my $o = Frey::Introspect->new( debug => $debug, class => $class ), 'new' ); isa_ok( $o, 'Frey::Introspect' ); diag dump( $o ) if $debug; @@ -27,16 +38,9 @@ is( $o->meta->name, 'Frey::Introspect', 'meta->name' ); ok( defined $o->debug, 'debug' ); - ok( ! $o->path, 'no path' ); - - ok( my $examine = $o->examine, 'examine' ); - diag dump( $examine ) if $debug; - - ok( $o->path, 'path' ); - my $cmd = 'js ' . $o->path; - my $syntax = `$cmd 2>&1`; - diag $syntax; + ok( my $js = $o->joose, 'joose' ); + diag dump( $js ) if $debug; - ok( ! $syntax, 'syntax' ); + last unless --$more; }