Commit | Line | Data |
7125b244 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
a28e50e4 |
6 | use Test::Builder::Tester; |
7125b244 |
7 | use Test::More; |
8 | |
28fdde7f |
9 | use 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 | |
28 | test_out('ok 1 - ... has_attribute_ok(Foo, foo) passes'); |
29 | |
30 | has_attribute_ok('Foo', 'foo', '... has_attribute_ok(Foo, foo) passes'); |
31 | |
32 | test_out ('not ok 2 - ... has_attribute_ok(Foo, bar) fails'); |
33 | test_fail (+2); |
34 | |
35 | has_attribute_ok('Foo', 'bar', '... has_attribute_ok(Foo, bar) fails'); |
36 | |
37 | test_out('ok 3 - ... has_attribute_ok(Bar, foo) passes'); |
38 | |
39 | has_attribute_ok('Bar', 'foo', '... has_attribute_ok(Bar, foo) passes'); |
40 | |
41 | test_out('ok 4 - ... has_attribute_ok(Bar, bar) passes'); |
42 | |
43 | has_attribute_ok('Bar', 'bar', '... has_attribute_ok(Bar, bar) passes'); |
44 | |
45 | test_test ('has_attribute_ok'); |
46 | |
a28e50e4 |
47 | done_testing; |