summaryrefslogtreecommitdiffstats
path: root/t/50-infer.t
diff options
context:
space:
mode:
Diffstat (limited to 't/50-infer.t')
-rw-r--r--t/50-infer.t59
1 files changed, 59 insertions, 0 deletions
diff --git a/t/50-infer.t b/t/50-infer.t
new file mode 100644
index 0000000..d3bd1cc
--- /dev/null
+++ b/t/50-infer.t
@@ -0,0 +1,59 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+{
+ package Foo;
+ use Moose;
+}
+
+{
+ package Bar;
+ use Moose;
+}
+
+{
+ package Baz;
+ use Moose;
+
+ has foo => (
+ is => 'ro',
+ isa => 'Foo',
+ required => 1,
+ );
+
+ has bar => (
+ is => 'ro',
+ isa => 'Bar',
+ required => 1,
+ );
+}
+
+{
+ package My::Container;
+ use Moose;
+ use Bread::Board::Declare;
+
+ has foo => (
+ is => 'ro',
+ isa => 'Foo',
+ );
+
+ has bar => (
+ is => 'ro',
+ isa => 'Bar',
+ );
+
+ has baz => (
+ is => 'ro',
+ isa => 'Baz',
+ );
+}
+
+my $c = My::Container->new;
+isa_ok($c->baz, 'Baz');
+isa_ok($c->baz->foo, 'Foo');
+isa_ok($c->baz->bar, 'Bar');
+
+done_testing;