use Test::More qw( no_plan); use_ok( q{Alpha} ); my $class = q{Alpha}; my $self = $class->new(); isa_ok($self, $class); can_ok($class, q{sayhowdy} ); is($self->sayhowdy(), qq{Howdy, alpha\n}, "alpha sayhowdy okay"); undef &Alpha::sayhowdy; eval { $self->sayhowdy(); }; like($@, qr/^Undefined subroutine &Alpha::sayhowdy called/, "Alpha::sayhowdy() is now undefined"); require_ok('Beta'); is($self->sayhowdy(), qq{Howdy, beta\n}, "Beta::sayhowdy is now Alpha::sayhowdy");