blob: eb3039134ad4d2597cfbe501d9129e5fc102bdea (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
|