[Jifty-commit] r4815 - in jifty/trunk: . lib/Jifty lib/Jifty/Test/WWW

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Jan 10 19:06:34 EST 2008


Author: alexmv
Date: Thu Jan 10 19:06:33 2008
New Revision: 4815

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Test.pm
   jifty/trunk/lib/Jifty/Test/WWW/Declare.pm
   jifty/trunk/t/TestApp/t/14-template-paths.t   (contents, props changed)

Log:
 r26589 at zoq-fot-pik:  chmrr | 2008-01-10 19:05:48 -0500
  * Jifty::Test::WWW::Declare doesn't call import_extra, so move
    'requires' and plan into ->setup
  * We have to use Jifty::Util in Jifty::Test, alas. :/
  * Remove bogus svn:keywords from a test file


Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Thu Jan 10 19:06:33 2008
@@ -4,6 +4,7 @@
 package Jifty::Test;
 use base qw/Test::More/;
 
+use Jifty::Util;
 use Email::LocalDelivery;
 use Email::Folder;
 use File::Path;
@@ -116,15 +117,7 @@
 sub import_extra {
     my $class = shift;
     my $args  = shift;
-    # Spit out a plan (if we got one) *before* we load modules, in
-    # case of compilation errors
-    $class->builder->plan(@{$args});
 
-    # Require the things we need
-    require Jifty::YAML;
-    require Jifty::Util;
-    require Jifty::Server;
-    require Jifty::Script::Schema;
     $class->setup($args);
     Test::More->export_to_level(2);
 
@@ -174,6 +167,17 @@
 
 sub setup {
     my $class = shift;
+    my $args = shift;
+
+    # Spit out a plan (if we got one) *before* we load modules, in
+    # case of compilation errors
+    $class->builder->plan(@{$args})
+      unless $class->builder->has_plan;
+
+    # Require the things we need
+    require Jifty::YAML;
+    require Jifty::Server;
+    require Jifty::Script::Schema;
 
     my $test_config = File::Temp->new( UNLINK => 0 );
     Jifty::YAML::DumpFile("$test_config", $class->test_config(Jifty::Config->new));

Modified: jifty/trunk/lib/Jifty/Test/WWW/Declare.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test/WWW/Declare.pm	(original)
+++ jifty/trunk/lib/Jifty/Test/WWW/Declare.pm	Thu Jan 10 19:06:33 2008
@@ -18,7 +18,7 @@
     Test::More->import(@_);
 
     # set up database and other things
-    Jifty::Test->setup($class);
+    Jifty::Test->setup(\@_);
 
     # export the DSL-ey functions
     Test::WWW::Declare->export_to_level(2);

Modified: jifty/trunk/t/TestApp/t/14-template-paths.t
==============================================================================
--- jifty/trunk/t/TestApp/t/14-template-paths.t	(original)
+++ jifty/trunk/t/TestApp/t/14-template-paths.t	Thu Jan 10 19:06:33 2008
@@ -51,6 +51,6 @@
 
 my $mech = Jifty::Test::WWW::Mechanize->new;
 foreach my $test (@tests) {
-    $mech->get_ok( $URL . $test->{url}, "get '$URL$test->{url}'" );
+    $mech->get_ok( $URL . $test->{url}, "get '$URL: $test->{url}'" );
     $mech->content_contains( $test->{text}, "found content '$test->{text}'" );
 }


More information about the Jifty-commit mailing list