bar->get_classes;
my $obj1 = $k1->new();
is(
$k1->FACTORY,
'MyApp',
);
isnt(
exception { $k2->new() },
undef,
);
isnt(
exception { $k2->new(foo => 42) },
undef,
);
my $obj2 = $k2->new(foo =
,
);
isa_ok(
$obj2,
substr($k1, 2),
) if $k1 =~ /^::/;
can_ok(
$k3,
'generate_package',
);
isnt(
exception { $k3->generate_package("foo") },
undef,
);
my $k4 = $k3->generate_package(666);
m
( [qw/ x y z /, { quux => \1 }] ) );
isnt(
exception { $bar->bar( [qw/ x y z /, { quux => 42 }] ) },
undef,
);
is_deeply( $bar->baz([1,2,3]), [1,2,3] );
isnt(
exception { $bar->baz(2) },
unde
age MyApp {
use Zydeco;
class Bar {
has foo (type => Foo);
}
}
my $foo = MyApp->new_foo;
my $bar = MyApp->new_bar(foo => $foo);
isnt(
exception { $bar->foo(undef) },
undef,
);
done_testing;
point->y,
2,
);
is(
$point->z,
3,
);
$point->clear;
is(
$point->x,
0,
);
is(
$point->y,
0,
);
is(
$point->z,
0,
);
isnt(
exception { $point->clear("yeah") },
undef,
);
done_testing;
le->new_baz(baz => 42)->baz, 42 );
my $foo = Local::Example->new_foo;
my $bar = Local::Example->new_bar;
is( $bar->do_it($foo), 66 );
isnt( exception{ $bar->do_it($bar) }, undef );
done_testing;
Y = 42;
my $k1 = MyApp2->generate_bumph;
$MyApp2::XYZZY = 666;
my $k2 = MyApp2->generate_bumph;
isnt(
exception { MyApp2->generate_bumph(5) },
undef,
);
is($k1->new->xyzzy, 42);
is($k2->new->xyzz
App->new_foo(this => 'xyz');
my $foo2 = MyApp->new_foo(that => 'xyz');
is_deeply($foo1, $foo2);
isnt(
exception { MyApp->new_foo(the_other => 'xyz') },
undef,
);
is(
$var,
ref($foo1),
);
done_
{$Role};
method xyzzy { return $_[1] }
}};
}
if (STRICT) {
is( $Class->new->xyzzy(4), 4 );
isnt( exception { $Class->new->xyzzy(1.1) }, undef );
}
else {
is( $Class->new->xyzzy(4), 4 );
is(
$y ];
}
}
}
}
my $foo = MyApp->new_foo;
is_deeply(
$foo->foo(2.1),
[ 'MyApp', 2 ],
);
isnt(
exception { $foo->foo("foo") },
undef,
);
my $bar = $foo->bar(3.1);
is(
ref($bar),
'CODE',