1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
use strict;
use Test;
# use a BEGIN block so we print our plan before module is loaded
BEGIN { use Exception::Handler }
BEGIN { plan tests => scalar(@Exception::Handler::EXPORT_OK), todo => [] }
BEGIN { $| = 1 }
# load your module...
use lib './';
# automated empty subclass test
# subclass Exception::Handler in package _Foo
package _Foo;
use strict;
use warnings;
use Exception::Handler qw( :all );
$Foo::VERSION = 0.00_0;
@_Foo::ISA = qw( Exception::Handler );
1;
# switch back to main package
package main;
# see if _Foo can do everything that Exception::Handler can do
map {
ok ref(UNIVERSAL::can('_Foo', $_)) eq 'CODE'
} @Exception::Handler::EXPORT_OK;
exit;
|