summaryrefslogtreecommitdiffstats
path: root/t/50-infer.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-05-25 14:05:49 -0500
committerJesse Luehrs <doy@tozt.net>2011-05-25 14:05:49 -0500
commit219d8e56458e61eab39c78395cddb9689256f512 (patch)
tree613ab6ae4c746e676f2fd45da2ae3c60519ce37d /t/50-infer.t
parentf3b0919453a6a370af34ee6f2e23dc8e0e251b42 (diff)
downloadbread-board-declare-219d8e56458e61eab39c78395cddb9689256f512.tar.gz
bread-board-declare-219d8e56458e61eab39c78395cddb9689256f512.zip
test for lack of inference
Diffstat (limited to 't/50-infer.t')
-rw-r--r--t/50-infer.t14
1 files changed, 14 insertions, 0 deletions
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',
+ );
}
{
@@ -67,6 +72,15 @@ use Test::Fatal;
}
{
+ 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;