Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 500_test_moose / 003_test_moose_has_attribute_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;
19
20     has 'foo', is => 'bare';
21 }
22
23 {
24     package Bar;
25     use Mouse;
26
27     extends 'Foo';
28
29     has 'bar', is => 'bare';
30 }
31
32
33 test_out('ok 1 - ... has_attribute_ok(Foo, foo) passes');
34
35 has_attribute_ok('Foo', 'foo', '... has_attribute_ok(Foo, foo) passes');
36
37 test_out ('not ok 2 - ... has_attribute_ok(Foo, bar) fails');
38 test_fail (+2);
39
40 has_attribute_ok('Foo', 'bar', '... has_attribute_ok(Foo, bar) fails');
41
42 test_out('ok 3 - ... has_attribute_ok(Bar, foo) passes');
43
44 has_attribute_ok('Bar', 'foo', '... has_attribute_ok(Bar, foo) passes');
45
46 test_out('ok 4 - ... has_attribute_ok(Bar, bar) passes');
47
48 has_attribute_ok('Bar', 'bar', '... has_attribute_ok(Bar, bar) passes');
49
50 test_test ('has_attribute_ok');
51
52 done_testing;