diff options
author | Toby Inkster <mail@tobyinkster.co.uk> | 2012-12-02 21:10:25 +0000 |
---|---|---|
committer | Toby Inkster <mail@tobyinkster.co.uk> | 2012-12-02 21:10:25 +0000 |
commit | e272a904f7483e5b7242f815e2bf42a746758e08 (patch) | |
tree | a78e4d31f9dd0c4c8dbecab72288c4e655aae738 /t | |
parent | 900a5e8c83b3cafb48ee4a2fcef1c9e72e6839ec (diff) |
get type constraints to inflate properly
Diffstat (limited to 't')
-rw-r--r-- | t/02inflation.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/02inflation.t b/t/02inflation.t new file mode 100644 index 0000000..7dcee9e --- /dev/null +++ b/t/02inflation.t @@ -0,0 +1,26 @@ +use strict; +use warnings; +use Test::More; + +BEGIN { + package Local::Class; + use Moo; + use MooX::late; + has foo => (is => 'ro', isa => 'Str', default => 'foo'); +}; + +ok not eval { + my $obj = Local::Class->new(foo => []) +}; + +eval { + require Moose; + + my $foo = Local::Class->meta->get_attribute('foo'); + is( + $foo->type_constraint->name, + 'Str', + ); +}; + +done_testing; |