diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-02-21 15:14:16 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-02-21 15:14:16 -0600 |
commit | 4595271c2aebc580c6957cfe3ae7e39f2d519865 (patch) | |
tree | acd7504c6f19cf9eab9a63a35a616902a57509d0 | |
parent | 35216d45b91d9ce8db4f7b0586fb6ec24970c57f (diff) | |
download | bread-board-declare-4595271c2aebc580c6957cfe3ae7e39f2d519865.tar.gz bread-board-declare-4595271c2aebc580c6957cfe3ae7e39f2d519865.zip |
few more tests for inheritance
-rw-r--r-- | t/20-inheritance.t | 12 | ||||
-rw-r--r-- | t/21-roles.t | 15 |
2 files changed, 27 insertions, 0 deletions
diff --git a/t/20-inheritance.t b/t/20-inheritance.t index d08b82a..b5e7b67 100644 --- a/t/20-inheritance.t +++ b/t/20-inheritance.t @@ -54,6 +54,18 @@ use Test::More; { my $parent = Parent->new; + ok($parent->has_service('foo'), "parent has foo"); + ok($parent->has_service('bar'), "parent has bar"); + + my $child = Child->new; + ok($child->has_service('foo'), "child has foo"); + ok($child->has_service('bar'), "child has bar"); + ok($child->has_service('baz'), "child has baz"); + ok($child->has_service('quux'), "child has quux"); +} + +{ + my $parent = Parent->new; isa_ok($parent, 'Bread::Board::Container'); is($parent->foo, 'FOO'); is($parent->bar, 'FOOBAR'); diff --git a/t/21-roles.t b/t/21-roles.t index 255039d..b2c5f2a 100644 --- a/t/21-roles.t +++ b/t/21-roles.t @@ -89,6 +89,21 @@ use Test::More; { my $parent = Parent->new; + ok($parent->has_service('role1'), "parent has role1"); + ok($parent->has_service('foo'), "parent has foo"); + ok($parent->has_service('bar'), "parent has bar"); + + my $child = Child->new; + ok($child->has_service('role1'), "child has role1"); + ok($child->has_service('foo'), "child has foo"); + ok($child->has_service('bar'), "child has bar"); + ok($child->has_service('role2'), "child has role2"); + ok($child->has_service('baz'), "child has baz"); + ok($child->has_service('quux'), "child has quux"); +} + +{ + my $parent = Parent->new; isa_ok($parent, 'Bread::Board::Container'); is($parent->role1, 'ROLE1'); is($parent->foo, 'FOO'); |