remove trailing whitespace
[gitmo/Moose.git] / t / 500_test_moose / 003_test_moose_has_attribute_ok.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use Test::Builder::Tester tests => 2;
7 use Test::More;
8
9 BEGIN {
10   use_ok('Test::Moose');
11 }
12
13 {
14     package Foo;
15     use Moose;
16
17     has 'foo';
18 }
19
20 {
21     package Bar;
22     use Moose;
23
24     extends 'Foo';
25
26     has 'bar';
27 }
28
29
30 test_out('ok 1 - ... has_attribute_ok(Foo, foo) passes');
31
32 has_attribute_ok('Foo', 'foo', '... has_attribute_ok(Foo, foo) passes');
33
34 test_out ('not ok 2 - ... has_attribute_ok(Foo, bar) fails');
35 test_fail (+2);
36
37 has_attribute_ok('Foo', 'bar', '... has_attribute_ok(Foo, bar) fails');
38
39 test_out('ok 3 - ... has_attribute_ok(Bar, foo) passes');
40
41 has_attribute_ok('Bar', 'foo', '... has_attribute_ok(Bar, foo) passes');
42
43 test_out('ok 4 - ... has_attribute_ok(Bar, bar) passes');
44
45 has_attribute_ok('Bar', 'bar', '... has_attribute_ok(Bar, bar) passes');
46
47 test_test ('has_attribute_ok');
48