From b4b04aaa5f710f713af97a0215e6c6e637010622 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 26 Feb 2011 18:40:14 -0600 Subject: another test --- t/11-multiple-instantiation.t | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 t/11-multiple-instantiation.t (limited to 't/11-multiple-instantiation.t') diff --git a/t/11-multiple-instantiation.t b/t/11-multiple-instantiation.t new file mode 100644 index 0000000..7c5d8a2 --- /dev/null +++ b/t/11-multiple-instantiation.t @@ -0,0 +1,40 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +{ + package Bar; + use Moose; + + has foo => ( + is => 'ro', + isa => 'Str', + required => 1, + ); +} + +{ + package Foo; + use Moose; + use Bread::Board::Declare; + + has foo => ( + is => 'ro', + isa => 'Str', + value => 'FOO', + ); + + has bar => ( + is => 'ro', + isa => 'Bar', + dependencies => ['foo'], + ); +} + +my $foo1 = Foo->new; +is($foo1->bar->foo, 'FOO'); +my $foo2 = Foo->new(foo => 'BAR'); +is($foo2->bar->foo, 'BAR'); + +done_testing; -- cgit v1.2.3