Permalink
Browse files

Add basic tests for values.

  • Loading branch information...
1 parent b36d1d4 commit 1d30631f0e36b06cd44e3993b8f5a5abf0069fe6 @racke committed Jun 8, 2012
Showing with 33 additions and 0 deletions.
  1. +1 −0 MANIFEST
  2. +32 −0 t/values/basic.t
View
@@ -61,6 +61,7 @@ t/filters/eol.t
t/filters/nobreak_single.t
t/filters/subs.t
t/filters/upper.t
+t/values/basic.t
t/i18n/01-simple.t
t/forms/01-name.t
t/forms/02-link.t
View
@@ -0,0 +1,32 @@
+#! perl -T
+#
+# Basic tests for values
+
+use strict;
+use warnings;
+
+use Test::More tests => 4;
+use Template::Flute;
+
+my ($spec, $html, $flute, $out);
+
+$spec = q{<specification>
+<value name="test"/>
+</specification>
+};
+
+$html = q{<div class="test">TEST</div>};
+
+for my $value (0, 1, ' ', 'test') {
+ $flute = Template::Flute->new(template => $html,
+ specification => $spec,
+ values => {test => $value},
+ );
+
+ $out = $flute->process();
+
+ ok ($out =~ m%<div class="test">$value</div>%,
+ "basic value test with: $value")
+ || diag $out;
+}
+

0 comments on commit 1d30631

Please sign in to comment.