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;
10 $TODO = q{Mouse is not yet completed};
17 has 'bar' => (is => 'ro');
22 has 'baz' => (is => 'ro', default => 'BAZ');
27 my $foo = Foo->new(bar => 'BAR');
30 is($foo->bar, 'BAR', '... got the expect value');
31 ok(!$foo->can('baz'), '... no baz method though');
34 Bar->meta->apply($foo)
37 is($foo->bar, 'BAR', '... got the expect value');
38 ok($foo->can('baz'), '... we have baz method now');
39 is($foo->baz, 'BAZ', '... got the expect value');
42 # with extra params ...
44 my $foo = Foo->new(bar => 'BAR');
47 is($foo->bar, 'BAR', '... got the expect value');
48 ok(!$foo->can('baz'), '... no baz method though');
51 Bar->meta->apply($foo, (rebless_params => { baz => 'FOO-BAZ' }))
54 is($foo->bar, 'BAR', '... got the expect value');
55 ok($foo->can('baz'), '... we have baz method now');
56 is($foo->baz, 'FOO-BAZ', '... got the expect value');
59 # with extra params ...
61 my $foo = Foo->new(bar => 'BAR');
64 is($foo->bar, 'BAR', '... got the expect value');
65 ok(!$foo->can('baz'), '... no baz method though');
68 Bar->meta->apply($foo, (rebless_params => { bar => 'FOO-BAR', baz => 'FOO-BAZ' }))
71 is($foo->bar, 'FOO-BAR', '... got the expect value');
72 ok($foo->can('baz'), '... we have baz method now');
73 is($foo->baz, 'FOO-BAZ', '... got the expect value');