Commit | Line | Data |
4060c871 |
1 | #!/usr/bin/perl |
1f5ce14a |
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; |
4060c871 |
5 | |
6 | use strict; |
7 | use warnings; |
8 | |
1f5ce14a |
9 | use Test::More; |
4060c871 |
10 | use Test::Exception; |
11 | |
12 | |
13 | |
14 | { |
15 | package Foo; |
16 | use Mouse; |
17 | |
18 | eval { |
19 | has 'foo' => ( |
20 | is => "rw", |
21 | init_arg => undef, |
22 | ); |
23 | }; |
24 | ::ok(!$@, '... created the attr okay'); |
25 | } |
26 | |
27 | { |
28 | my $foo = Foo->new( foo => "bar" ); |
29 | isa_ok($foo, 'Foo'); |
30 | |
31 | is( $foo->foo, undef, "field is not set via init arg" ); |
32 | |
33 | $foo->foo("blah"); |
34 | |
35 | is( $foo->foo, "blah", "field is set via setter" ); |
36 | } |
1f5ce14a |
37 | |
38 | done_testing; |