summaryrefslogtreecommitdiffstats
path: root/t/mustache-spec.t
diff options
context:
space:
mode:
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;