File: 21-load-subclassed.t

package info (click to toggle)
libtest-class-perl 0.52-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 540 kB
  • sloc: perl: 1,706; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 658 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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'
}