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

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Sep 2 21:13:35 EDT 2007


Author: ruz
Date: Sun Sep  2 21:13:35 2007
New Revision: 4033

Added:
   Template-Declare/t/siblings.t

Log:
* add tests for various siblings

Added: Template-Declare/t/siblings.t
==============================================================================
--- (empty file)
+++ Template-Declare/t/siblings.t	Sun Sep  2 21:13:35 2007
@@ -0,0 +1,52 @@
+use warnings;
+use strict;
+
+
+package Wifty::UI;
+use base qw/Template::Declare/;
+use Template::Declare::Tags;
+use Test::More tests => 7;
+require "t/utils.pl";
+
+template tag_tag => sub {
+    head { }
+    body { }
+};
+
+template tag_show => sub {
+    h1 { 'heading' }
+    show('tag_tag')
+};
+
+template tag_text => sub {
+    h1 { }
+    'text'
+};
+
+
+Template::Declare->init(roots => ['Wifty::UI']);
+
+
+{
+    Template::Declare->buffer->clear;
+    my $simple =(show('tag_tag'));
+    like($simple, qr/head.*body/ms, 'body after head');
+    ok_lint($simple);
+}
+
+{
+    Template::Declare->buffer->clear;
+    my $simple =(show('tag_show'));
+    like($simple, qr/\A\s*<h1/ms, 'show() after tag');
+    ok_lint($simple);
+}
+
+{
+    Template::Declare->buffer->clear;
+    my $simple =(show('tag_text'));
+    like($simple, qr/\A\s*<h1/ms, 'show() after tag');
+    like($simple, qr/text/ms, 'show() after tag');
+    ok_lint($simple);
+}
+
+1;


More information about the Jifty-commit mailing list