Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 100_bugs / 007_reader_precedence_bug.t
1 #!/usr/bin/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
6 use strict;
7 use warnings;
8
9 use Test::More;
10
11 {
12     package Foo;
13     use Mouse;
14     has 'foo' => ( is => 'ro', reader => 'get_foo' );
15 }
16
17 {
18     my $foo = Foo->new(foo => 10);
19     my $reader = $foo->meta->get_attribute('foo')->reader;
20     is($reader, 'get_foo',
21        'reader => "get_foo" has correct presedence');
22     can_ok($foo, 'get_foo');
23     is($foo->$reader, 10, "Reader works as expected");
24 }
25
26 done_testing;