inlining for overloaded object isa/coerce
[gitmo/Moo.git] / t / buildargs-error.t
1 use strictures 1;
2 use Test::More;
3 use Test::Fatal;
4
5 {
6     package Foo;
7     use Moo;
8
9     has bar => ( is => "rw" );
10     has baz => ( is => "rw" );
11
12     sub BUILDARGS {
13         my ($self, $args) = @_;
14
15         return %$args
16     }
17 }
18
19 like(
20   exception { Foo->new({ bar => 1, baz => 1 }) },
21   qr/BUILDARGS did not return a hashref/,
22   'Sensible error message'
23 );
24
25 done_testing;
26