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