added tests for scripts
[catagits/CatalystX-HelpText.git] / t / script.t
CommitLineData
e5459d76 1#!/usr/bin/env perl
2
3use strict;
4use warnings;
5use Test::More;
6use Test::Exception;
7# setup library path
8use FindBin qw($Bin);
9use lib "$Bin/lib";
10use Data::Dumper;
11my $path = "$Bin/lib/TestApp/root/";
12
13use_ok 'CatalystX::HelpText::Script::SearchUndocumentedHelpText';
14my $script;
15lives_ok {
16 $script = CatalystX::HelpText::Script::SearchUndocumentedHelpText
17 ->new_with_options(
18 help_files_path => "$path/helptext",
19 template_search_dir => "$path",
20 finder_class => "CatalystX::HelpText::Finder::TemplateToolkit",
21 filename_pattern => '\W',
22 );
23} "don't break";
24
25my $files = [
26 $path.'undocumented',
27 $path.'main',
28 $path.'helptext/fnoo.html',
29 ];
30is_deeply $script->all_files, $files, "Files found";
31is_deeply $script->all_keys, [ 'undocumented', 'fnoo' ], "All keys found";
32is_deeply $script->undocumented_keys, [ 'undocumented' ], "undocumented keys found";
33is_deeply $script->documented_keys, [ 'fnoo' ], "documented keys found";
34
35done_testing;