summaryrefslogblamecommitdiffstats
path: root/t/constructor-name.t
blob: f1daf419dcd7bd6e5cb7471b9b933b0c655777b1 (plain) (tree)
1
2
3
4
5
6
7
8
9



                   
                


                
                                       






                                  
                              



                                  



                                     
                

                             
        

             
#!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use Test::Moose;

{
    package Bar;
    BEGIN { $INC{'Bar.pm'} = __FILE__ }

    sub create { bless {}, shift }
}

{
    package Foo;
    use Moose;
    use Bread::Board::Declare;

    has bar => (
        is               => 'ro',
        isa              => 'Bar',
        constructor_name => 'create',
    );
}

with_immutable {
    my $foo = Foo->new;
    isa_ok($foo->bar, 'Bar');
} 'Foo';

done_testing;