summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules3
m---------t/mustache-spec0
-rw-r--r--t/mustache-spec.t25
3 files changed, 28 insertions, 0 deletions
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..3c752dc
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "t/mustache-spec"]
+ path = t/mustache-spec
+ url = git://github.com/mustache/spec.git
diff --git a/t/mustache-spec b/t/mustache-spec
new file mode 160000
+Subproject 72233f3ffda9e33915fd3022d0a9ebbcce265ac
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;