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