4 use Test::More tests => 13;
7 require_ok("MooseX::Adopt::Class::Accessor::Fast");
8 use_ok('TestAdoptCAF');
11 ok(TestAdoptCAF->can('meta'), 'Adopt seems to work');
12 ok(TestAdoptCAF->meta->find_attribute_by_name($_), "attribute $_ created")
17 local $SIG{__WARN__} = sub {
18 die "Warning generated when new was called with no arguments: " .
21 TestAdoptCAF->new(());
23 ok( ref($ok), ref($ok) ? "no warnings when instantiating object" : $@);
26 my $t = TestAdoptCAF->new(foo => 100, bar => 200, groditi => 300);
27 is($t->{foo}, 100, '$self->{foo} set');
28 is($t->{bar}, 200, '$self->{bar} set');
29 is($t->{groditi}, 300, '$self->{groditi} set');
32 my $u = TestAdoptCAF->new({foo => 100, bar => 200, groditi => 300});
33 is($u->{foo}, 100, '$self->{foo} set');
34 is($u->{bar}, 200, '$self->{bar} set');
35 is($u->{groditi}, 300, '$self->{groditi} set');