summaryrefslogtreecommitdiffstats
path: root/t/mustache-spec.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-02 18:12:19 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-02 18:12:19 -0500
commit94428a37525ef84c4ed075a5dc9dddcf23debd00 (patch)
treef9154800e86c04e0cc3738fbd46ea002bca3794a /t/mustache-spec.t
parentf5a6d16466fd528171002a137440e9d99eb9129a (diff)
downloadtext-handlebars-94428a37525ef84c4ed075a5dc9dddcf23debd00.tar.gz
text-handlebars-94428a37525ef84c4ed075a5dc9dddcf23debd00.zip
add mustache spec tests - 136/224 passing so far
Diffstat (limited to 't/mustache-spec.t')
-rw-r--r--t/mustache-spec.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/mustache-spec.t b/t/mustache-spec.t
new file mode 100644
index 0000000..eb30391
--- /dev/null
+++ b/t/mustache-spec.t
@@ -0,0 +1,25 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use lib 't/lib';
+use Test::More;
+use Test::Handlebars;
+
+use Test::Requires 'JSON', 'Path::Class';
+
+for my $file (dir('t', 'mustache-spec', 'specs')->children) {
+ next unless $file =~ /\.json$/;
+ next if $file->basename =~ /^~/; # for now
+ my $tests = decode_json($file->slurp);
+ diag("running " . $file->basename . " tests");
+ for my $test (@{ $tests->{tests} }) {
+ render_ok(
+ $test->{template},
+ $test->{data},
+ $test->{expected},
+ "$test->{name}: $test->{desc}"
+ );
+ }
+}
+
+done_testing;