[Jifty-commit] r3262 - in Template-Declare: t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sat May 19 15:57:16 EDT 2007
Author: jesse
Date: Sat May 19 15:57:16 2007
New Revision: 3262
Modified:
Template-Declare/ (props changed)
Template-Declare/t/deep_aliasing.t
Template-Declare/t/deep_importing.t
Template-Declare/t/private.t
Log:
r56977 at pinglin: jesse | 2007-05-19 15:56:57 -0400
* Test suite now actually tests the warnings we expect to provide
Modified: Template-Declare/t/deep_aliasing.t
==============================================================================
--- Template-Declare/t/deep_aliasing.t (original)
+++ Template-Declare/t/deep_aliasing.t Sat May 19 15:57:16 2007
@@ -35,7 +35,8 @@
package main;
Template::Declare->init( roots => ['MyApp::View'] );
-use Test::More tests => 10;
+use Test::More tests => 12;
+use Test::Warn;
require "t/utils.pl";
ok( MyApp::View->has_template('toplevel') );
@@ -53,13 +54,22 @@
like( $simple, qr'Toplevel' );
}
{
- my $simple = ( Template::Declare->show('listing'));
- unlike( $simple, qr'listing' , 'can not call a toplevel "listing" template');
+ warning_like {
+ my $simple = ( Template::Declare->show('listing') ||'');
+ unlike( $simple, qr'listing',
+ 'can not call a toplevel "listing" template' );
+ }
+ qr/The template 'listing' could not be found/,
+ "listing is private"
+
}
-{
- my $simple = ( Template::Declare->show('search'));
+warning_like {
+ my $simple = ( Template::Declare->show('search')||'');
unlike( $simple, qr'search', "Can not call a toplevel /search" );
-}
+} qr/The template 'search' could not be found/, "Search could not be found";
+
+
+
{
my $simple = ( Template::Declare->show('/plugin/listing'));
Modified: Template-Declare/t/deep_importing.t
==============================================================================
--- Template-Declare/t/deep_importing.t (original)
+++ Template-Declare/t/deep_importing.t Sat May 19 15:57:16 2007
@@ -35,7 +35,8 @@
package main;
Template::Declare->init( roots => ['MyApp::View'] );
-use Test::More tests => 10;
+use Test::More tests => 12;
+use Test::Warn;
require "t/utils.pl";
ok( MyApp::View->has_template('toplevel') );
@@ -52,18 +53,21 @@
my $simple = ( Template::Declare->show('toplevel'))||'';
like( $simple, qr'Toplevel' );
}
+warning_like
{
my $simple = ( Template::Declare->show('listing'))||'';
unlike( $simple, qr'listing' , 'can not call a toplevel "listing" template');
}
+qr/The template 'listing' could not be found/, "calling a missing component gets warned";
{
my $simple = ( Template::Declare->show('/plugin/listing'))||'';
like( $simple, qr'listing', "Can call /plugin/listing" );
}
-{
+warning_like {
my $simple = ( Template::Declare->show('search'))||'';
unlike( $simple, qr'search', "Can not call a toplevel /search" );
}
+qr/The template 'search' could not be found/, "calling a missing component gets warned";
{
my $simple = ( Template::Declare->show('/plugin/search')) ||'';
like( $simple, qr'search' , "Can call /plugin/search");
Modified: Template-Declare/t/private.t
==============================================================================
--- Template-Declare/t/private.t (original)
+++ Template-Declare/t/private.t Sat May 19 15:57:16 2007
@@ -80,7 +80,6 @@
{
my $simple;
- $simple = ( Template::Declare->show('private-content') );
warning_like
{ $simple = ( Template::Declare->show('private-content') ); }
qr/could not be found.*private/,
More information about the Jifty-commit
mailing list