{
package Test::Moose::Meta::TypeConstraint::Union;
-
- use overload '""' => sub { 'Broken|Test' }, fallback => 1;
+
+ use overload '""' => sub {'Broken|Test'}, fallback => 1;
use Moose;
-
+
extends 'Moose::Meta::TypeConstraint';
}
-ok my $dummy_instance = Test::Moose::Meta::TypeConstraint::Union->new
- => "Created Instance";
+my $dummy_instance = Test::Moose::Meta::TypeConstraint::Union->new;
+
+ok $dummy_instance => "Created Instance";
+
+isa_ok $dummy_instance,
+ 'Test::Moose::Meta::TypeConstraint::Union' => 'isa correct type';
+
+is "$dummy_instance", "Broken|Test" =>
+ 'Got expected stringification result';
+
+my $subtype1 = subtype 'New1' => as $dummy_instance;
+
+ok $subtype1 => 'made a subtype from our type object';
-isa_ok $dummy_instance, 'Test::Moose::Meta::TypeConstraint::Union'
- => 'isa correct type';
+my $subtype2 = subtype 'New2' => as $subtype1;
-is "$dummy_instance", "Broken|Test"
- => "Got expected stringification result";
-
-ok my $subtype1 = subtype('New1', as $dummy_instance)
- => "made a subtype";
-
-ok my $subtype2 = subtype('New2', as $subtype1)
- => "made another subtype";
+ok $subtype2 => 'made a subtype of our subtype';