Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 900_mouse_bugs / 009_RT57144.t
CommitLineData
a5347147 1#!/usr/bin/perl
2# https://rt.cpan.org/Public/Bug/Display.html?id=57144
3use strict;
4use Test::More;
5
6package Hoge;
7use Mouse;
8
9has 'fuga' => (
10 is => 'rw',
11 isa => 'Str',
12 lazy_build => 1,
13);
14
15has 'hoge' => (
16 is => 'rw',
17 isa => 'Str',
18 lazy_build => 1,
19);
20
21sub _build_fuga {
22 shift->hoge;
23}
24
25sub _build_hoge {
26 eval "use Hoge::Hoge"; ## no critic
27 "HOGE";
28}
29
30sub msg {
31 shift->fuga;
32}
33
34package main;
35use strict;
36use warnings;
37
9a87d68a 38my $hoge = Hoge->new;
39is $hoge->msg, "HOGE";
a5347147 40
41done_testing;