#!/usr/bin/env perl
use
strict;
use
warnings;
use
Test::More;
BEGIN {
sub
import
{
my
$caller
=
caller
;
BEGIN::Lift::install(
(
$caller
,
'extends'
) =>
sub
{
no
strict
'refs'
;
@{
$caller
.
'::ISA'
} =
@_
;
}
);
}
}
our
$EXCEPTION
;
BEGIN {
eval
q{
package Bar;
use strict; use warnings;
package Foo;
use strict; use warnings;
BEGIN { Cariboo->import() }
1;
} or
do
{
$EXCEPTION
=
"$@"
;
};
is(
$EXCEPTION
,
undef
,
'... got no error (as expected)'
);
is_deeply(\
@Foo::ISA
, [
'Bar'
],
'... and Foo::ISA was altered as expected'
);
}
done_testing;
1;