use warnings;
use Test::More;
-use Test::Fatal;
+use Test::Exception;
{
use Moose;
use Moose::Util::TypeConstraints;
- ::ok ! ::exception {
+ ::lives_ok {
has 'customers' => (
is => 'ro',
isa => subtype('ArrayRef' => where {
(blessed($_) && $_->isa('Customer') || return) for @$_; 1 }),
auto_deref => 1,
);
- }, '... successfully created attr';
+ } '... successfully created attr';
}
{
{
my $autoderef = AutoDeref->new;
- ok exception {
+ dies_ok {
$autoderef->bar(1, 2, 3);
- }, '... its auto-de-ref-ing, not auto-en-ref-ing';
+ } '... its auto-de-ref-ing, not auto-en-ref-ing';
- ok ! exception {
+ lives_ok {
$autoderef->bar([ 1, 2, 3 ])
- }, '... set the results of bar correctly';
+ } '... set the results of bar correctly';
is_deeply [ $autoderef->bar ], [ 1, 2, 3 ], '... auto-dereffed correctly';
}