Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory usw-pr-cvs1:/tmp/cvs-serv6159/t
Modified Files:
01-api.t
Log Message:
Now HTTP::WebTest do validates global test parameters.
Index: 01-api.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/01-api.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** 01-api.t 2002/01/28 06:32:02 1.2
--- 01-api.t 2002/01/28 07:11:05 1.3
***************
*** 16,20 ****
use vars qw($HOSTNAME $PORT $URL);
! BEGIN { plan tests => 15 }
# init test
--- 16,20 ----
use vars qw($HOSTNAME $PORT $URL);
! BEGIN { plan tests => 16 }
# init test
***************
*** 113,127 ****
}
! # 10: check how webtest handlers broken tests
{
my $tests = [ { url => [] } ];
check_webtest(webtest => $WEBTEST,
server_url => $URL,
tests => $tests,
check_file => 't/test.out/broken-test');
}
! # 11-12: parse wt script
{
my $data = read_file('t/simple.wt');
--- 113,146 ----
}
! # 10-11: check how webtest handles broken tests
{
my $tests = [ { url => [] } ];
+ # no bad global params
check_webtest(webtest => $WEBTEST,
server_url => $URL,
tests => $tests,
check_file => 't/test.out/broken-test');
+
+ # some bad global params
+ eval {
+ my $opts = { plugins => '',
+ mail_addresses => '',
+ mail => {},
+ mail_server => {},
+ mail_from => [] };
+ $WEBTEST->run_tests($tests, $opts);
+ };
+ if($@) {
+ my $res = $@;
+ $res =~ s/(at )\S+( line )\d+(\.)$/$1SomeFile$2SomeLine$3/;
+ compare_output(output_ref => \$res,
+ check_file => 't/test.out/check-global-params');
+ } else {
+ ok(0);
+ }
}
! # 12-13: parse wt script
{
my $data = read_file('t/simple.wt');
***************
*** 132,136 ****
}
! # 13: run tests defined in wt script
{
generate_wscript(file => 't/real.wt', server_url => $URL);
--- 151,155 ----
}
! # 14: run tests defined in wt script
{
generate_wscript(file => 't/real.wt', server_url => $URL);
***************
*** 145,149 ****
}
! # 14-15: test num_fail and num_succeed
{
my $tests = [ { url => abs_url($URL, '/test-file1') },
--- 164,168 ----
}
! # 15-16: test num_fail and num_succeed
{
my $tests = [ { url => abs_url($URL, '/test-file1') },
|