rt 4.0.23
[freeside.git] / rt / t / 00-mason-syntax.t
1 use strict;
2 use warnings;
3
4 use RT::Test nodb => 1;
5
6
7 use File::Find;
8 find( {
9     no_chdir => 1,
10     wanted   => sub {
11         return if /(?:\.(?:jpe?g|png|gif|rej)|\~)$/i;
12         return if m{/\.[^/]+\.swp$}; # vim swap files
13         return unless -f $_;
14         local ($@);
15         ok( eval { compile_file($_) }, "Compiled $File::Find::name ok: $@");
16     },
17 }, RT::Test::get_relocatable_dir('../share/html'));
18
19 use HTML::Mason;
20 use HTML::Mason::Compiler;
21 use HTML::Mason::Compiler::ToObject;
22 BEGIN { require RT::Test; }
23
24 sub compile_file {
25     my $file = shift;
26
27     my $text = Encode::decode( "UTF-8", RT::Test->file_content($file));
28
29     my $compiler = new HTML::Mason::Compiler::ToObject;
30     $compiler->compile(
31         comp_source => $text,
32         name => 'my',
33         comp_path => 'my',
34     );
35     return 1;
36 }
37