2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
17 has 'bar' => (is => 'rw', isa => 'ArrayRef | HashRef');
25 } '... set bar successfully with an ARRAY ref';
29 } '... set bar successfully with a HASH ref';
33 } '... couldnt set bar successfully with a number';
37 } '... couldnt set bar successfully with a CODE ref';
39 # check the constructor
43 } '... created new Foo with bar successfully set with an ARRAY ref';
47 } '... created new Foo with bar successfully set with a HASH ref';
51 } '... didnt create a new Foo with bar as a number';
54 Foo->new(bar => sub {})
55 } '... didnt create a new Foo with bar as a CODE ref';
61 has 'baz' => (is => 'rw', isa => 'Str | CodeRef');
69 } '... set baz successfully with a string';
72 $bar->baz(sub { 'a sub' })
73 } '... set baz successfully with a CODE ref';
76 $bar->baz(\(my $var1))
77 } '... couldnt set baz successfully with a SCALAR ref';
81 } '... couldnt set bar successfully with a HASH ref';
83 # check the constructor
86 Bar->new(baz => 'a string')
87 } '... created new Bar with baz successfully set with a string';
90 Bar->new(baz => sub { 'a sub' })
91 } '... created new Bar with baz successfully set with a CODE ref';
94 Bar->new(baz => \(my $var2))
95 } '... didnt create a new Bar with baz as a number';
99 } '... didnt create a new Bar with baz as a HASH ref';