use
lib
qw( ./lib ./t/lib ../inc ./inc )
;
isa_ok(DoesQuux,
"Type::Tiny"
,
"DoesQuux"
);
isa_ok(DoesQuux,
"Type::Tiny::Role"
,
"DoesQuux"
);
should_fail(
"Foo::Bar"
->new, DoesQuux);
should_pass(
"Foo::Baz"
->new, DoesQuux);
should_fail(
undef
, DoesQuux);
should_fail({}, DoesQuux);
should_fail(FooBar, DoesQuux);
should_fail(FooBaz, DoesQuux);
should_fail(DoesQuux, DoesQuux);
should_fail(
"Quux"
, DoesQuux);
is(
'Type::Tiny::Role'
->new(
role
=>
'Xyzzy'
)->inline_check(
'$x'
),
'Type::Tiny::Role'
->new({
role
=>
'Xyzzy'
})->inline_check(
'$x'
),
'constructor can be passed a hash or hashref'
,
);
done_testing;