[Rt-commit] r3934 - rt/branches/3.5-TESTING/lib/t/regression
ruz at bestpractical.com
ruz at bestpractical.com
Wed Oct 5 20:41:57 EDT 2005
Author: ruz
Date: Wed Oct 5 20:41:56 2005
New Revision: 3934
Modified:
rt/branches/3.5-TESTING/lib/t/regression/03web_compiliation_errors.t
Log:
* tests cleanup, print diag messages only if we $ENV{TEST_VERBOSE} is true
prove -v set this
* print diag message with URL we test
Modified: rt/branches/3.5-TESTING/lib/t/regression/03web_compiliation_errors.t
==============================================================================
--- rt/branches/3.5-TESTING/lib/t/regression/03web_compiliation_errors.t (original)
+++ rt/branches/3.5-TESTING/lib/t/regression/03web_compiliation_errors.t Wed Oct 5 20:41:56 2005
@@ -12,22 +12,18 @@
my $agent = WWW::Mechanize->new();
# give the agent a place to stash the cookies
-
$agent->cookie_jar($cookie_jar);
use RT;
-RT::LoadConfig;
-
-use RT;
RT::LoadConfig();
+
# get the top page
my $url = "http://localhost:".$RT::WebPort.$RT::WebPath."/";
-diag $url;
+diag "Base URL is '$url'" if $ENV{TEST_VERBOSE};
$agent->get($url);
is ($agent->{'status'}, 200, "Loaded a page");
-
# {{{ test a login
# follow the link marked "Login"
@@ -48,20 +44,19 @@
find ( \&wanted , 'html/');
sub wanted {
- -f && /\.html$/ && $_ !~ /Logout.html$/ && test_get($File::Find::name);
+ -f && /\.html$/ && $_ !~ /Logout.html$/ && test_get($File::Find::name);
}
sub test_get {
my $file = shift;
-
- $file =~ s#^html/##;
+ $file =~ s#^html/##;
+ diag( "testing $url/$file" ) if $ENV{TEST_VERBOSE};
ok ($agent->get("$url/$file", "GET $url/$file"));
is ($agent->{'status'}, 200, "Loaded $file");
# ok( $agent->{'content'} =~ /Logout/i, "Found a logout link on $file ");
ok( $agent->{'content'} !~ /Not logged in/i, "Still logged in for $file");
ok( $agent->{'content'} !~ /raw error/i, "Didn't get a Mason compilation error on $file");
-
}
# }}}
More information about the Rt-commit
mailing list