[Jifty-commit] r6063 - Template-Declare/t

Jifty commits jifty-commit at lists.jifty.org
Tue Dec 2 01:08:36 EST 2008


Author: ruz
Date: Tue Dec  2 01:08:35 2008
New Revision: 6063

Added:
   Template-Declare/t/nested_show.t

Log:
* add a test for a thing that has been broken recently

Added: Template-Declare/t/nested_show.t
==============================================================================
--- (empty file)
+++ Template-Declare/t/nested_show.t	Tue Dec  2 01:08:35 2008
@@ -0,0 +1,30 @@
+use warnings;
+use strict;
+
+package Wifty::UI;
+use base qw/Template::Declare/;
+use Template::Declare::Tags;
+use Test::More tests => 2;
+require "t/utils.pl";
+
+template a_tag => sub { em {} };
+
+template show => sub { show 'a_tag' };
+
+template show_in_tag => sub { div { show 'a_tag' } };
+
+Template::Declare->init(roots => ['Wifty::UI']);
+
+{
+    Template::Declare->buffer->clear;
+    my $simple =(show('show'));
+    like($simple, qr{^\s*<em>\s*</em>\s*$}ms, 'show => sub { div { show a_tag } }');
+}
+
+{
+    Template::Declare->buffer->clear;
+    my $simple =(show('show_in_tag'));
+    like($simple, qr{^\s*<div>\s*<em>\s*</em>\s*</div>\s*$}ms, 'show => sub { div { show a_tag } }');
+}
+
+1;


More information about the Jifty-commit mailing list