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

Jifty commits jifty-commit at lists.jifty.org
Mon Feb 9 17:16:53 EST 2009


Author: alexmv
Date: Mon Feb  9 17:16:53 2009
New Revision: 6325

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Test.pm
   jifty/trunk/lib/Jifty/Test/WWW/Declare.pm
   jifty/trunk/t/00-load.t
   jifty/trunk/t/11-config-files.t
   jifty/trunk/t/TestApp/t/04-sessions.t
   jifty/trunk/t/TestApp/t/05-editactions-Record.t

Log:
 r41971 at kohr-ah:  chmrr | 2009-02-09 17:16:34 -0500
 Warnings avoidance in tests


Modified: jifty/trunk/lib/Jifty/Test.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test.pm	(original)
+++ jifty/trunk/lib/Jifty/Test.pm	Mon Feb  9 17:16:53 2009
@@ -179,6 +179,9 @@
     require Jifty::Server;
     require Jifty::Script::Schema;
 
+    my %args = @{$args} % 2 ? (@{$args}, 1) : @{$args};
+    $class->builder->{no_handle} = $args{no_handle};
+
     my $test_config = File::Temp->new( UNLINK => 0 );
     Jifty::YAML::DumpFile("$test_config", $class->test_config(Jifty::Config->new));
     # Invoking bin/jifty and friends will now have the test config ready.
@@ -224,6 +227,10 @@
 sub setup_test_database {
     my $class = shift;
 
+    if ($class->builder->{no_handle}) {
+        Jifty->new( no_handle => 1 );
+        return;
+    }
 
     if ($ENV{JIFTY_FAST_TEST}) {
 	local $SIG{__WARN__} = sub {};

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	Mon Feb  9 17:16:53 2009
@@ -26,6 +26,7 @@
     # export $server, $URL, and whatever else J:T:W:D adds
     # note that this must come AFTER T:W:D->export because we override some
     # of its functions
+    no warnings 'redefine';
     __PACKAGE__->export_to_level(1);
 
     # create a server (which will be automatically exported)

Modified: jifty/trunk/t/00-load.t
==============================================================================
--- jifty/trunk/t/00-load.t	(original)
+++ jifty/trunk/t/00-load.t	Mon Feb  9 17:16:53 2009
@@ -1,6 +1,6 @@
 #!/usr/bin/env perl -w
 use strict;
-use Test::More tests => 2;
+use Test::More tests => 2, no_handle => 1;
 
 use_ok('Jifty::Everything');
 use_ok('Jifty::Test');

Modified: jifty/trunk/t/11-config-files.t
==============================================================================
--- jifty/trunk/t/11-config-files.t	(original)
+++ jifty/trunk/t/11-config-files.t	Mon Feb  9 17:16:53 2009
@@ -5,15 +5,11 @@
 
 =head1 DESCRIPTION
 
-This is a template for your own tests. Copy it and modify it.
+Check that nested config files work as expected
 
 =cut
 
-use Jifty::Test tests => 2;
-
-use_ok('Jifty');
-
-Jifty->new(no_handle => 1);
+use Jifty::Test tests => 1, no_handle => 1;
 
 is(Jifty->config->framework('WhichConfigFile'), 'site', "We set the driver to what's in the site config file");
 

Modified: jifty/trunk/t/TestApp/t/04-sessions.t
==============================================================================
--- jifty/trunk/t/TestApp/t/04-sessions.t	(original)
+++ jifty/trunk/t/TestApp/t/04-sessions.t	Mon Feb  9 17:16:53 2009
@@ -3,10 +3,7 @@
 use warnings;
 use strict;
 
-use Jifty::Test::Dist tests => 11;
-
-use_ok('Jifty');
-Jifty->new();
+use Jifty::Test::Dist tests => 10;
 
 use_ok('Jifty::Web::Session');
 

Modified: jifty/trunk/t/TestApp/t/05-editactions-Record.t
==============================================================================
--- jifty/trunk/t/TestApp/t/05-editactions-Record.t	(original)
+++ jifty/trunk/t/TestApp/t/05-editactions-Record.t	Mon Feb  9 17:16:53 2009
@@ -9,7 +9,6 @@
 # Make sure we can load the model
 use_ok('TestApp::Model::User');
 
-Jifty->new();
 # Grab a system use
 my $system_user = TestApp::CurrentUser->superuser;
 ok($system_user, "Found a system user");


More information about the Jifty-commit mailing list