diff options
Diffstat (limited to 't/33-constructor-name.t')
-rw-r--r-- | t/33-constructor-name.t | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/t/33-constructor-name.t b/t/33-constructor-name.t new file mode 100644 index 0000000..28647ee --- /dev/null +++ b/t/33-constructor-name.t @@ -0,0 +1,30 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +{ + package Bar; + + sub create { bless {}, shift } +} + +{ + package Foo; + use Moose; + use MooseX::Bread::Board; + + has bar => ( + is => 'ro', + isa => 'Bar', + class => 'Bar', + constructor_name => 'create', + ); +} + +{ + my $foo = Foo->new; + isa_ok($foo->bar, 'Bar'); +} + +done_testing; |