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