Convert to Dist::Zilla
[p5sagit/namespace-clean.git] / t / 02-inheritance.t
1 #!/usr/bin/env perl
2 use warnings;
3 use strict;
4
5 use FindBin;
6 use lib "$FindBin::Bin/lib";
7 use Test::More tests => 10;
8
9 use_ok('Inheritance');
10 ok( !InheritanceParent->can('foo'),
11     'function removed in parent' );
12 ok( InheritanceParent->can('bar'),
13     'method still in parent' );
14 is( InheritanceParent->bar, 23,
15     'method works, function still bound' );
16 ok( !Inheritance->can('baz'),
17     'function removed in subclass' );
18 ok( Inheritance->can('qux'),
19     'method still in subclass' );
20 ok( !Inheritance->can('foo'),
21     'parent function not available in subclass' );
22 ok( Inheritance->can('bar'),
23     'parent method available in subclass' );
24 is( Inheritance->bar, 23,
25     'parent method works in subclass' );
26 is( Inheritance->qux, 23,
27     'subclass method calls to parent work' );
28