From 219d8e56458e61eab39c78395cddb9689256f512 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 25 May 2011 14:05:49 -0500 Subject: test for lack of inference --- t/50-infer.t | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 't') diff --git a/t/50-infer.t b/t/50-infer.t index 983e1a3..2b064a3 100644 --- a/t/50-infer.t +++ b/t/50-infer.t @@ -52,6 +52,11 @@ use Test::Fatal; isa => 'Baz', infer => 1, ); + + has baz_no_infer => ( + is => 'ro', + isa => 'Baz', + ); } { @@ -66,6 +71,15 @@ use Test::Fatal; isa_ok($c->resolve(type => 'Baz'), 'Baz'); } +{ + my $c = My::Container->new; + like( + exception { $c->baz_no_infer }, + qr/^Attribute \(bar\) is required/, + "not inferred when not requested" + ); +} + { package Baz2; use Moose; -- cgit v1.2.3