File: 21-load-subclassed.t

package info (click to toggle)
libtest-class-perl 0.35-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 476 kB
  • ctags: 102
  • sloc: perl: 1,668; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 676 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl 

use strict;
use warnings;
use Test::More tests => 7;
use lib './t';
use TestClassLoadSubclass 't/test-libs/lib3';

ok exists $INC{'Tests/Good1.pm'},
  'Classes in top level directories should be loaded';

ok exists $INC{'Tests/Subdir/Good3.pm'},
  '... as should classes in subdirectories';

ok !exists $INC{'Tests/Bad1.pm'},
  'Filtered out classes in top level directories should *not* be loaded';

ok !exists $INC{'Tests/Subdir/Bad2.pm'},
  'Filtered out classes in subdirectories should *not* be loaded';

for my $class (qw(Tests::Good1 Tests::Good2 Tests::Subdir::Good3)) {
    is $class->ok(), $class, 'Class ' . $class . ' method work as expected'
}