3 use Test::More tests => 18;
5 use Scalar::Util qw/isweak/;
19 use MouseX::Types -declare => [qw/Foo/];
20 use MouseX::Types::Mouse 'HashRef';
21 class_type Foo, { class => 'Headers' };
37 BEGIN { Types->import('Foo') }
53 trigger => sub { \$_[0]->bone('eat') },
55 sub BUILD { main::ok "calling BUILD in SoftDog" }
63 lives_ok { $class->new(bone => 'moo') } "$class new";
64 throws_ok { $class->new() } qr/\QAttribute (bone) is required/;
65 is($class->new(bone => 'moo', foo => { data => 3 })->foo->data, 3);
67 my $foo = Headers->new();
68 ok(Scalar::Util::isweak($class->new(bone => 'moo', weak_foo => $foo)->{weak_foo}));
71 my $o = $class->new(bone => 'moo');
72 $o->trigger_foo($foo);
82 HardDog->meta->make_immutable;