[Jifty-commit] r3261 - in Template-Declare: lib/Template
lib/Template/Declare t
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Sat May 19 15:43:30 EDT 2007
Author: jesse
Date: Sat May 19 15:43:30 2007
New Revision: 3261
Modified:
Template-Declare/ (props changed)
Template-Declare/lib/Template/Declare.pm
Template-Declare/lib/Template/Declare/Tags.pm
Template-Declare/t/arg-declaration-styles.t
Template-Declare/t/attributes.t
Template-Declare/t/closures.t
Template-Declare/t/deep_importing.t
Template-Declare/t/private.t
Template-Declare/t/subclassing.t
Template-Declare/t/utils.pl
Log:
r56974 at pinglin: jesse | 2007-05-19 15:43:02 -0400
* Test suite cleanup
Modified: Template-Declare/lib/Template/Declare.pm
==============================================================================
--- Template-Declare/lib/Template/Declare.pm (original)
+++ Template-Declare/lib/Template/Declare.pm Sat May 19 15:43:30 2007
@@ -437,8 +437,8 @@
sub _subname {
my $prefix = shift;
my $template = shift || '';
- $template =~ s{^/+}{};
$template =~ s{/+}{/}g;
+ $template =~ s{^/}{};
return join( '', $prefix, $template );
}
Modified: Template-Declare/lib/Template/Declare/Tags.pm
==============================================================================
--- Template-Declare/lib/Template/Declare/Tags.pm (original)
+++ Template-Declare/lib/Template/Declare/Tags.pm Sat May 19 15:43:30 2007
@@ -9,7 +9,7 @@
use Carp;
@EXPORT
- = qw( with template private show attr outs outs_raw in_isolation $self under get_current_attr smart_tag_wrapper );
+ = qw( with template private show show_page attr outs outs_raw in_isolation $self under get_current_attr smart_tag_wrapper );
push @EXPORT, qw(Tr td ); # these two warns the user to use row/cell instead
our %ATTRIBUTES = ();
Modified: Template-Declare/t/arg-declaration-styles.t
==============================================================================
--- Template-Declare/t/arg-declaration-styles.t (original)
+++ Template-Declare/t/arg-declaration-styles.t Sat May 19 15:43:30 2007
@@ -69,14 +69,16 @@
Template::Declare->init(roots => ['TestApp::UI']);
for (qw(content content_curly content_explicit)) {
- ok_content( show($_), $_ );
+Template::Declare->buffer->clear;
+ ok_content( show_page($_), $_ );
}
for (
qw(content_mixed1 content_mixed2 content_attrs content_withs content_curlies)
)
{
- ok_multicontent( show($_), $_ );
+Template::Declare->buffer->clear;
+ ok_multicontent( show_page($_), $_ );
}
sub ok_multicontent {
Modified: Template-Declare/t/attributes.t
==============================================================================
--- Template-Declare/t/attributes.t (original)
+++ Template-Declare/t/attributes.t Sat May 19 15:43:30 2007
@@ -47,7 +47,7 @@
use Test::More tests => 10;
require "t/utils.pl";
{
- my $simple = (show('attr_with_one_arg'));
+ my $simple = (show_page('attr_with_one_arg'));
ok($simple =~ m{^\s*<div\s+id="id">\s*<p>\s*This is my content\s*</p>\s*</div>\s*$}s);
#diag ($simple);
ok_lint($simple);
@@ -55,7 +55,7 @@
Template::Declare->buffer->clear;
{
- my $simple = (show('attr_with_two_args'));
+ my $simple = (show_page('attr_with_two_args'));
ok($simple =~ m{^\s*<div\s+id="id">\s*<p>\s*This is my content\s*</p>\s*</div>\s*$}s);
#diag ($simple);
ok_lint($simple);
@@ -63,7 +63,7 @@
Template::Declare->buffer->clear;
{
- my $simple = (show('attr_with_many_args'));
+ my $simple = (show_page('attr_with_many_args'));
ok($simple =~ m{^\s*
<div\s+id="id">\s*
<p>\s*This\sis\smy\scontent\s*</p>\s*
@@ -76,7 +76,7 @@
Template::Declare->buffer->clear;
{
- my $simple = (show('with'));
+ my $simple = (show_page('with'));
ok($simple =~ m{^\s*<div\s+id="id">\s*<p>\s*This is my content\s*</p>\s*</div>\s*$}s);
#diag ($simple);
ok_lint($simple);
@@ -84,7 +84,7 @@
Template::Declare->buffer->clear;
{
- my $simple = (show('with_with_two_blocks'));
+ my $simple = (show_page('with_with_two_blocks'));
ok($simple =~ m{^\s*
<div\s+id="id">\s*<p>\s*This\sis\smy\scontent\s*</p>\s*</div>\s*
<div>\s*<p>\s*another\sparagraph\s*</p>\s*</div>\s*
Modified: Template-Declare/t/closures.t
==============================================================================
--- Template-Declare/t/closures.t (original)
+++ Template-Declare/t/closures.t Sat May 19 15:43:30 2007
@@ -120,7 +120,7 @@
Template::Declare->buffer->clear;
my $simple = Template::Declare->show('closure_6');
ok($simple =~ /I decided to do\s*<i>\s*Something else\s*<\/i>/);
-diag ($simple);
+#diag ($simple);
ok_lint(Template::Declare->buffer->data());
}
Modified: Template-Declare/t/deep_importing.t
==============================================================================
--- Template-Declare/t/deep_importing.t (original)
+++ Template-Declare/t/deep_importing.t Sat May 19 15:43:30 2007
@@ -49,23 +49,23 @@
{
- my $simple = ( Template::Declare->show('toplevel'));
+ my $simple = ( Template::Declare->show('toplevel'))||'';
like( $simple, qr'Toplevel' );
}
{
- my $simple = ( Template::Declare->show('listing'));
+ my $simple = ( Template::Declare->show('listing'))||'';
unlike( $simple, qr'listing' , 'can not call a toplevel "listing" template');
}
{
- my $simple = ( Template::Declare->show('/plugin/listing'));
+ my $simple = ( Template::Declare->show('/plugin/listing'))||'';
like( $simple, qr'listing', "Can call /plugin/listing" );
}
{
- my $simple = ( Template::Declare->show('search'));
+ my $simple = ( Template::Declare->show('search'))||'';
unlike( $simple, qr'search', "Can not call a toplevel /search" );
}
{
- my $simple = ( Template::Declare->show('/plugin/search'));
+ 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:43:30 2007
@@ -16,7 +16,7 @@
};
private template 'private-content' => sub {
- with( id => 'body' ), div {
+ with( id => 'private-content-body' ), div {
outs('This is my content');
};
@@ -24,7 +24,7 @@
private template 'other-content' => sub {
- with( id => 'body' ), div {
+ with( id => 'other-content-body' ), div {
outs('This is other content');
};
Modified: Template-Declare/t/subclassing.t
==============================================================================
--- Template-Declare/t/subclassing.t (original)
+++ Template-Declare/t/subclassing.t Sat May 19 15:43:30 2007
@@ -78,8 +78,8 @@
{ $simple = ( show('does_not_exist') ); }
qr/could not be found.*private/,
"got warning";
- unlike( $simple , qr'This is my content' );
- is ($simple, undef);
+ unlike( ($simple||'') , qr'This is my content' );
+ is ($simple,undef);
}
{
Modified: Template-Declare/t/utils.pl
==============================================================================
--- Template-Declare/t/utils.pl (original)
+++ Template-Declare/t/utils.pl Sat May 19 15:43:30 2007
@@ -6,14 +6,14 @@
sub ok_lint {
my $html = shift;
-
+
+ {
my $lint = HTML::Lint->new;
-
- $lint->parse($html);
- is( $lint->errors, 0, "Lint checked clean" );
+ $lint->parse($html);
+ is( $lint->errors, 0, "Lint checked clean" );
foreach my $error ( $lint->errors ) {
diag( $error->as_string );
- }
+ }}
}
More information about the Jifty-commit
mailing list