Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 100_bugs / 007_reader_precedence_bug.t
CommitLineData
4c98ebb0 1#!/usr/bin/perl
ee5e6a03 2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
4c98ebb0 5
6use strict;
7use warnings;
8
ee5e6a03 9use Test::More;
4c98ebb0 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
ee5e6a03 26done_testing;