summaryrefslogtreecommitdiffstats
path: root/t/33-constructor-name.t
blob: 28647eeccefd5bf0fa920758560b92af7765a1ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;