Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 500_test_moose / 003_test_moose_has_attribute_ok.t
CommitLineData
ca5d8e24 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!!!
4use t::lib::MooseCompat;
5
6use strict;
7use warnings;
8
9use Test::Builder::Tester;
10use Test::More;
11
12BEGIN {
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
33test_out('ok 1 - ... has_attribute_ok(Foo, foo) passes');
34
35has_attribute_ok('Foo', 'foo', '... has_attribute_ok(Foo, foo) passes');
36
37test_out ('not ok 2 - ... has_attribute_ok(Foo, bar) fails');
38test_fail (+2);
39
40has_attribute_ok('Foo', 'bar', '... has_attribute_ok(Foo, bar) fails');
41
42test_out('ok 3 - ... has_attribute_ok(Bar, foo) passes');
43
44has_attribute_ok('Bar', 'foo', '... has_attribute_ok(Bar, foo) passes');
45
46test_out('ok 4 - ... has_attribute_ok(Bar, bar) passes');
47
48has_attribute_ok('Bar', 'bar', '... has_attribute_ok(Bar, bar) passes');
49
50test_test ('has_attribute_ok');
51
52done_testing;