[prev] [thread] [next] [lurker] [Date index for 2003/10/22]
Author: richardc Date: 2003-10-22 15:59:46 +0100 (Wed, 22 Oct 2003) New Revision: 1462 Modified: trunk/siesta/t/02all_plugins.t Log: turn the available_plugins tests into multiple tests so we can see which (if any) fail Modified: trunk/siesta/t/02all_plugins.t =================================================================== --- trunk/siesta/t/02all_plugins.t 2003-10-22 10:12:51 UTC (rev 1461) +++ trunk/siesta/t/02all_plugins.t 2003-10-22 14:59:46 UTC (rev 1462) @@ -4,32 +4,23 @@ use strict; use File::Find::Rule qw(find); -use lib qw(t/lib lib); +use lib qw(t/lib); use Siesta::Test; use Siesta; -my @files = find( name => '*.pm', in => 'blib/lib/Siesta/Plugin' ); +my @files = find( name => '*.pm', relative => in => 'blib/lib/Siesta/Plugin' ); require Test::More; -Test::More->import( tests => ((@files *2) + 1) ); +Test::More->import( tests => @files * 3 ); -my @plugins; - -for my $class (@files) { - $class =~ s{blib/lib/(.*).pm}{$1}; - $class =~ s{/}{::}g; - push @plugins, $class; +for my $file (@files) { + $file =~ s/\.pm$//; + my $class = "Siesta::Plugin::$file"; require_ok($class); eval { $class->description }; ok( !$@, "$class has a description" ); } - my %plugins = map { $_ => 1 } Siesta->available_plugins; - -my $result = 1; -foreach my $p (@plugins) { - $p =~ s/^Siesta::Plugin:://; - $result &&= $plugins{$p} || 0; +for my $plugin (@files) { + ok( $plugins{$plugin}, "$plugin in available_plugins" ); } -is($result,1,"available plugins were all found"); -
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52