Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 900_mouse_bugs / 007_RT56523.t
CommitLineData
6cff6b7a 1#!/usr/bin/perl
2use strict;
3use Test::More;
3823fbc7 4#warn $Mouse::VERSION;
6cff6b7a 5{
6 package Foo;
7
8 use Mouse;
9
10 has thing => (
11 reader => 'thing',
12 writer => 'set_thing',
13 builder => '_build_thing',
14 lazy => 1,
15 );
16
17 sub _build_thing {
18 42;
19 }
20}
21
22# Get them set
23{
24 my $obj = Foo->new;
25 is $obj->thing, 42;
26 $obj->set_thing( 23 );
27 is $obj->thing, 23;
28}
29
30# Set then get
31{
32 my $obj = Foo->new;
33 $obj->set_thing(23);
34 is $obj->thing, 23;
35}
36
37done_testing();