~ubuntu-branches/ubuntu/maverick/libmodule-starter-plugin-cgiapp-perl/maverick

« back to all changes in this revision

Viewing changes to t/module-build.t

  • Committer: Bazaar Package Importer
  • Author(s): Jaldhar H. Vyas
  • Date: 2009-01-15 22:09:04 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090115220904-2o9itfe4h8ypafs7
Tags: 0.10-1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
 
14
14
qx{ $cgiapp_starter --mb };
15
15
 
16
 
my @expected_files = (
17
 
    'Foo',                   'Foo/lib',
18
 
    'Foo/lib/Foo.pm',        'Foo/lib/Foo',
19
 
    'Foo/lib/Foo/templates', 'Foo/lib/Foo/templates/runmode1.html',
20
 
    'Foo/t',                 'Foo/t/www',
21
 
    'Foo/t/pod-coverage.t',  'Foo/t/pod.t',
22
 
    'Foo/t/test-app.t',      'Foo/t/01-load.t',
23
 
    'Foo/t/perl-critic.t',   'Foo/t/boilerplate.t',
24
 
    'Foo/t/00-signature.t',  'Foo/t/perlcriticrc',
25
 
    'Foo/Build.PL',          'Foo/Changes',
26
 
    'Foo/README',            'Foo/MANIFEST.SKIP',
27
 
    'Foo/MANIFEST',          'Foo/server.pl',
28
 
);
29
 
 
30
 
my %got_files;
31
 
foreach my $file (@expected_files) {
32
 
    $got_files{$file} = -1;
33
 
}
34
 
 
35
 
File::Find::find(
36
 
    {   no_chdir => 1,
37
 
        wanted  => sub {
38
 
            if ( -e $File::Find::name ) {
39
 
                my $name = $File::Find::name;
40
 
                $name =~ s{\A\Q$dir\E}{}msx;
41
 
                $got_files{$name} = grep { $_ eq $name } @expected_files;
42
 
            }
43
 
            return;
44
 
            }
45
 
    },
46
 
    $root,
47
 
);
48
 
 
49
 
plan tests => ( scalar keys %got_files ) * 2;
50
 
 
51
 
foreach my $file ( keys %got_files ) {
52
 
    ok( $got_files{$file} > -1, "Missing file $file" );
53
 
}
54
 
 
55
 
foreach my $file ( keys %got_files ) {
56
 
    ok( $got_files{$file}, "Extra file $file" );
57
 
}
 
16
push @expected_files, 'Foo/Build.PL';
 
17
 
 
18
run_tests();
58
19
 
59
20
END {
60
21
    if ( -d $root ) {