14 has 'bar' => (is => 'rw', isa => 'ArrayRef | HashRef');
22 }, undef, '... set bar successfully with an ARRAY ref' );
26 }, undef, '... set bar successfully with a HASH ref' );
30 }, undef, '... couldnt set bar successfully with a number' );
34 }, undef, '... couldnt set bar successfully with a CODE ref' );
36 # check the constructor
40 }, undef, '... created new Foo with bar successfully set with an ARRAY ref' );
44 }, undef, '... created new Foo with bar successfully set with a HASH ref' );
48 }, undef, '... didnt create a new Foo with bar as a number' );
51 Foo->new(bar => sub {})
52 }, undef, '... didnt create a new Foo with bar as a CODE ref' );
58 has 'baz' => (is => 'rw', isa => 'Str | CodeRef');
66 }, undef, '... set baz successfully with a string' );
69 $bar->baz(sub { 'a sub' })
70 }, undef, '... set baz successfully with a CODE ref' );
73 $bar->baz(\(my $var1))
74 }, undef, '... couldnt set baz successfully with a SCALAR ref' );
78 }, undef, '... couldnt set bar successfully with a HASH ref' );
80 # check the constructor
83 Bar->new(baz => 'a string')
84 }, undef, '... created new Bar with baz successfully set with a string' );
87 Bar->new(baz => sub { 'a sub' })
88 }, undef, '... created new Bar with baz successfully set with a CODE ref' );
91 Bar->new(baz => \(my $var2))
92 }, undef, '... didnt create a new Bar with baz as a number' );
96 }, undef, '... didnt create a new Bar with baz as a HASH ref' );