Implement strict constructors, which will warn unkown constructor arguments
[gitmo/Mouse.git] / t / 100_bugs / 007_reader_precedence_bug.t
CommitLineData
4c98ebb0 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 3;
7
8{
9 package Foo;
10 use Mouse;
11 has 'foo' => ( is => 'ro', reader => 'get_foo' );
12}
13
14{
15 my $foo = Foo->new(foo => 10);
16 my $reader = $foo->meta->get_attribute('foo')->reader;
17 is($reader, 'get_foo',
18 'reader => "get_foo" has correct presedence');
19 can_ok($foo, 'get_foo');
20 is($foo->$reader, 10, "Reader works as expected");
21}
22
23
24
25