use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 6;
{
}
{
+ package Subclass;
+
+ use MooseX::StrictConstructor;
+
+ extends 'Stricter';
+
+ has 'size' => ( is => 'rw' );
+}
+
+{
package Tricky;
use MooseX::StrictConstructor;
eval { Tricky->new( thing => 1, agent => 99 ) };
like( $@, qr/unknown attribute.+: agent/, 'Tricky still blows up on unknown params other than spy' );
+
+eval { Subclass->new( thing => 1, bad => 99 ) };
+like( $@, qr/unknown attribute.+: bad/, 'subclass constructor blows up on unknown params' );
+
+eval { Subclass->new( thing => 1, size => 'large' ) };
+is( $@, '', 'subclass constructor handles known attributes correctly' );