show the first line here when testing with a harness
[gitmo/Moose.git] / t / attributes / accessor_inlining.t
CommitLineData
f001c60f 1#!/usr/bin/env perl
2use strict;
3use warnings;
4use Test::More;
5
6my $called;
7{
8 package Foo::Meta::Instance;
9 use Moose::Role;
10
11 sub is_inlinable { 0 }
12
13 after get_slot_value => sub { $called++ };
14}
15
16{
17 package Foo;
18 use Moose;
19 Moose::Util::MetaRole::apply_metaroles(
20 for => __PACKAGE__,
21 class_metaroles => {
22 instance => ['Foo::Meta::Instance'],
23 },
24 );
25
26 has foo => (is => 'ro');
27}
28
29my $foo = Foo->new(foo => 1);
30is($foo->foo, 1, "got the right value");
31is($called, 1, "reader was called");
32
33done_testing;