[Jifty-commit] r3777 - in Test-WWW-Declare: lib/Test/WWW t

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Fri Aug 3 16:28:39 EDT 2007


Author: sartak
Date: Fri Aug  3 16:28:39 2007
New Revision: 3777

Modified:
   Test-WWW-Declare/   (props changed)
   Test-WWW-Declare/Makefile.PL
   Test-WWW-Declare/lib/Test/WWW/Declare.pm
   Test-WWW-Declare/t/00-load.t
   Test-WWW-Declare/t/01-basic.t
   Test-WWW-Declare/t/02-skip.t

Log:
 r29878 at caladan:  sartak | 2007-08-03 16:28:24 -0400
 Various and sundry little fixes


Modified: Test-WWW-Declare/Makefile.PL
==============================================================================
--- Test-WWW-Declare/Makefile.PL	(original)
+++ Test-WWW-Declare/Makefile.PL	Fri Aug  3 16:28:39 2007
@@ -6,6 +6,10 @@
 
 requires 'WWW::Mechanize';
 requires 'Test::Builder';
+requires 'Test::More';
+
+build_requires 'HTTP::Server::Simple::CGI';
+build_requires 'Test::Tester';
 
 WriteAll;
 

Modified: Test-WWW-Declare/lib/Test/WWW/Declare.pm
==============================================================================
--- Test-WWW-Declare/lib/Test/WWW/Declare.pm	(original)
+++ Test-WWW-Declare/lib/Test/WWW/Declare.pm	Fri Aug  3 16:28:39 2007
@@ -1,14 +1,14 @@
 package Test::WWW::Declare;
 use warnings;
 use strict;
-use base 'Test::More', 'Exporter';
+use base 'Test::More';
 use WWW::Mechanize;
 use Test::Builder;
 
 our $VERSION  = '0.00';
 
 our @EXPORT = qw(flow run get session check mech match follow link content
-                 should shouldnt click href button fill form SKIP);
+                 should shouldnt click href button fill form SKIP _twd_dummy);
 our $BUILDER = Test::Builder->new();
 our $WWW_MECHANIZE;
 
@@ -164,13 +164,16 @@
         $BUILDER->skip($reason);
     }
     elsif ($@) {
-        $BUILDER->diag($@);
         $BUILDER->ok(0, $title);
+        $BUILDER->diag($@);
     }
     else {
         $BUILDER->ok(1, $title);
     }
 }
 
+# used only for testing that we got T:W:D's goods
+sub _twd_dummy { "XYZZY" }
+
 1;
 

Modified: Test-WWW-Declare/t/00-load.t
==============================================================================
--- Test-WWW-Declare/t/00-load.t	(original)
+++ Test-WWW-Declare/t/00-load.t	Fri Aug  3 16:28:39 2007
@@ -1,6 +1,10 @@
 #!perl
-use Test::More tests => 2;
+use Test::WWW::Declare::Tester tests => 3;
 
-use_ok 'Test::WWW::Declare';
-use_ok 'Test::WWW::Declare::Tester';
+ok(1, "successfully got Test::More's exportables");
+
+my @results = run_tests(sub { isnt(2 + 2, 5) } );
+is(@results, 2, "successfully got Test::Tester's exportables");
+
+is(_twd_dummy(), "XYZZY", "successfully got Test::WWW::Declare's exportables");
 

Modified: Test-WWW-Declare/t/01-basic.t
==============================================================================
--- Test-WWW-Declare/t/01-basic.t	(original)
+++ Test-WWW-Declare/t/01-basic.t	Fri Aug  3 16:28:39 2007
@@ -22,5 +22,5 @@
 ok($results[1]{ok}, "2nd test passed");
 
 is($results[0]{name}, "basic connectivity", "1st test was flow");
-is($results[1]{name}, "check logins", "1st test was flow");
+is($results[1]{name}, "check logins", "2nd test was session");
 

Modified: Test-WWW-Declare/t/02-skip.t
==============================================================================
--- Test-WWW-Declare/t/02-skip.t	(original)
+++ Test-WWW-Declare/t/02-skip.t	Fri Aug  3 16:28:39 2007
@@ -7,6 +7,7 @@
     sub {
         session "check logins" => run {
             flow "basic connectivity" => check {
+                get "http://localhost:$PORT/";
                 SKIP "Just testing skip";
             };
         };


More information about the Jifty-commit mailing list