Update of /cvsroot/http-webtest/HTTP-WebTest/t
In directory usw-pr-cvs1:/tmp/cvs-serv29975/t
Modified Files:
08-plugins.t
Added Files:
StartTests.pm
Log Message:
Test if start_tests hook get triggered in plugins dynimcally loaded in
tests init stage
--- NEW FILE: StartTests.pm ---
# $Id: StartTests.pm,v 1.1 2002/05/26 20:03:16 m_ilya Exp $
package StartTests;
use strict;
use base qw(HTTP::WebTest::Plugin);
sub start_tests {
my $self = shift;
$StartTests::counter ++;
}
1;
Index: 08-plugins.t
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest/t/08-plugins.t,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** 08-plugins.t 24 Jan 2002 12:26:17 -0000 1.1.1.1
--- 08-plugins.t 26 May 2002 20:03:16 -0000 1.2
***************
*** 18,22 ****
use vars qw($HOSTNAME $PORT $URL);
! BEGIN { plan tests => 3 }
# init tests
--- 18,22 ----
use vars qw($HOSTNAME $PORT $URL);
! BEGIN { plan tests => 4 }
# init tests
***************
*** 65,68 ****
--- 65,85 ----
tests => $tests,
check_file => 't/test.out/plugin-hello-counter');
+ }
+
+ # 4: test with StartTests plugin (plugin which defines start_tests
+ # hook)
+ {
+ # reset counter which get increased in StartTests::start_tests()
+ $StartTests::counter = 0;
+
+ my $opts = { plugins => [ 'StartTests',
+ 'HTTP::WebTest::Plugin::Counter' ],
+ default_report => 'no' };
+
+ my $tests = [ ];
+
+ $WEBTEST->run_tests($tests, $opts);
+
+ ok($StartTests::counter == 1);
}
|