fix documentation of type heirarchy
[gitmo/Moose.git] / t / test_moose / test_moose_has_attribute_ok.t
CommitLineData
7125b244 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
a28e50e4 6use Test::Builder::Tester;
7125b244 7use Test::More;
8
28fdde7f 9use Test::Moose;
7125b244 10
11{
12 package Foo;
13 use Moose;
d03bd989 14
ccd4cff9 15 has 'foo', is => 'bare';
7125b244 16}
17
18{
19 package Bar;
20 use Moose;
d03bd989 21
7125b244 22 extends 'Foo';
d03bd989 23
ccd4cff9 24 has 'bar', is => 'bare';
7125b244 25}
26
27
28test_out('ok 1 - ... has_attribute_ok(Foo, foo) passes');
29
30has_attribute_ok('Foo', 'foo', '... has_attribute_ok(Foo, foo) passes');
31
32test_out ('not ok 2 - ... has_attribute_ok(Foo, bar) fails');
33test_fail (+2);
34
35has_attribute_ok('Foo', 'bar', '... has_attribute_ok(Foo, bar) fails');
36
37test_out('ok 3 - ... has_attribute_ok(Bar, foo) passes');
38
39has_attribute_ok('Bar', 'foo', '... has_attribute_ok(Bar, foo) passes');
40
41test_out('ok 4 - ... has_attribute_ok(Bar, bar) passes');
42
43has_attribute_ok('Bar', 'bar', '... has_attribute_ok(Bar, bar) passes');
44
45test_test ('has_attribute_ok');
46
a28e50e4 47done_testing;