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