From d1149a69c6121025816d388fadc3861e7407c594 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 21 Feb 2011 01:34:02 -0600 Subject: support the constructor_name option --- t/33-constructor-name.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 t/33-constructor-name.t (limited to 't/33-constructor-name.t') 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; -- cgit v1.2.3