summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;