Commit | Line | Data |
fde8e43f |
1 | #!/usr/bin/env perl |
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; |
5 | use strict; |
6 | use warnings; |
7 | use Test::More; |
8 | $TODO = q{Mouse is not yet completed}; |
9 | |
10 | my $called; |
11 | { |
12 | package Foo::Meta::Instance; |
13 | use Mouse::Role; |
14 | |
15 | sub is_inlinable { 0 } |
16 | |
17 | after get_slot_value => sub { $called++ }; |
18 | } |
19 | |
20 | { |
21 | package Foo; |
22 | use Mouse; |
23 | Mouse::Util::MetaRole::apply_metaroles( |
24 | for => __PACKAGE__, |
25 | class_metaroles => { |
26 | instance => ['Foo::Meta::Instance'], |
27 | }, |
28 | ); |
29 | |
30 | has foo => (is => 'ro'); |
31 | } |
32 | |
33 | my $foo = Foo->new(foo => 1); |
34 | is($foo->foo, 1, "got the right value"); |
35 | is($called, 1, "reader was called"); |
36 | |
37 | done_testing; |