use warnings;
use Test::More;
-use Test::Fatal;
+use Test::Exception;
{
package Foo;
package Bar;
use Moose;
- ::ok ! ::exception {
+ ::lives_ok {
has 'baz' => (
is => 'ro',
isa => 'Foo',
default => sub { Foo->new() },
handles => qr/^a$/,
);
- }, '... can create the attribute with delegations';
+ } '... can create the attribute with delegations';
}
my $bar;
-ok ! exception {
+lives_ok {
$bar = Bar->new;
-}, '... created the object ok';
+} '... created the object ok';
isa_ok($bar, 'Bar');
is($bar->a, 'Foo::a', '... got the right delgated value');
package Baz;
use Moose;
- ::ok ! ::exception {
+ ::lives_ok {
has 'bar' => (
is => 'ro',
isa => 'Foo',
default => sub { Foo->new() },
handles => qr/.*/,
);
- }, '... can create the attribute with delegations';
+ } '... can create the attribute with delegations';
}
my $baz;
-ok ! exception {
+lives_ok {
$baz = Baz->new;
-}, '... created the object ok';
+} '... created the object ok';
isa_ok($baz, 'Baz');
is($baz->a, 'Foo::a', '... got the right delgated value');
package Blart;
use Moose;
- ::ok ! ::exception {
+ ::lives_ok {
has 'bar' => (
is => 'ro',
isa => 'Foo',
default => sub { Foo->new() },
handles => [qw(a new)],
);
- }, '... can create the attribute with delegations';
+ } '... can create the attribute with delegations';
}
my $blart;
-ok ! exception {
+lives_ok {
$blart = Blart->new;
-}, '... created the object ok';
+} '... created the object ok';
isa_ok($blart, 'Blart');
is($blart->a, 'Foo::a', '... got the right delgated value');