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