Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 500_test_moose / 002_test_moose_does_ok.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::Builder::Tester;
10 use Test::More;
11
12 BEGIN {
13   use_ok('Test::Mouse');
14 }
15
16 {
17     package Foo;
18     use Mouse::Role;
19 }
20
21 {
22     package Bar;
23     use Mouse;
24
25     with qw/Foo/;
26 }
27
28 {
29     package Baz;
30     use Mouse;
31 }
32
33 # class ok
34
35 test_out('ok 1 - does_ok class');
36
37 does_ok('Bar','Foo','does_ok class');
38
39 # class fail
40
41 test_out ('not ok 2 - does_ok class fail');
42 test_fail (+2);
43
44 does_ok('Baz','Foo','does_ok class fail');
45
46 # object ok
47
48 my $bar = Bar->new;
49
50 test_out ('ok 3 - does_ok object');
51
52 does_ok ($bar,'Foo','does_ok object');
53
54 # object fail
55
56 my $baz = Baz->new;
57
58 test_out ('not ok 4 - does_ok object fail');
59 test_fail (+2);
60
61 does_ok ($baz,'Foo','does_ok object fail');
62
63 test_test ('does_ok');
64
65 done_testing;