Commit | Line | Data |
7125b244 |
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; |
d03bd989 |
16 | |
9e70af87 |
17 | has 'foo'; |
7125b244 |
18 | } |
19 | |
20 | { |
21 | package Bar; |
22 | use Moose; |
d03bd989 |
23 | |
7125b244 |
24 | extends 'Foo'; |
d03bd989 |
25 | |
9e70af87 |
26 | has 'bar'; |
7125b244 |
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 | |