Merge branch 'master' into WebGUI8. Merged up to 7.9.12

This commit is contained in:
Colin Kuskie 2010-08-13 12:25:19 -07:00
commit 3e8e2d452c
27 changed files with 333 additions and 77 deletions

View file

@ -16,13 +16,14 @@ use WebGUI::Test;
use WebGUI::Session;
use WebGUI::Pluggable;
use WebGUI::Operation::Help;
use Test::More;
use Test::Exception;
#The goal of this test is to verify that all entries in the lib/WebGUI/Help
#directory compile. This test is necessary because WebGUI::Operation::Help
#will return an empty hash if it won't compile, and the help will simply
#disappear.
use Test::More;
my $numTests = 0;
my $session = WebGUI::Test->session;
@ -31,10 +32,19 @@ my @helpFileSet = WebGUI::Pluggable::findAndLoad('WebGUI::Help');
$numTests = scalar @helpFileSet; #One for each help compile
plan tests => $numTests;
plan tests => $numTests + 2;
foreach my $helpFile (@helpFileSet) {
my ($namespace) = $helpFile =~ m{WebGUI::Help::(.+$)};
my $help = WebGUI::Operation::Help::_load($session, $namespace);
ok(keys %{ $help }, "$namespace compiled");
}
#----------------------------------------------------------------------------
# Test invalid help files
WebGUI::Test->interceptLogging( sub {
my $log_data = shift;
lives_ok { WebGUI::Operation::Help::_load( $session, '::HI::' ) } "invalid help module doesnt die";
like( $log_data->{error}, qr/^Help failed to compile/, 'invalid help module errored' );
});