7 package Foo; use Moo; sub BUILD { push @ran, 'Foo' }
8 package Bar; use Moo; extends 'Foo'; sub BUILD { push @ran, 'Bar' }
9 package Baz; use Moo; extends 'Bar';
10 package Quux; use Moo; extends 'Baz'; sub BUILD { push @ran, 'Quux' }
17 has 'foo' => (is => 'ro');
18 sub BUILD { push @ran, $_[0]->foo, $_[1]->{bar} }
23 is(ref($o), 'Quux', 'object returned');
24 is_deeply(\@ran, [ qw(Foo Bar Quux) ], 'BUILDs ran in order');
28 $o = Fleem->new(foo => 'Fleem1', bar => 'Fleem2');
30 is(ref($o), 'Fleem', 'object with inline constructor returned');
31 is_deeply(\@ran, [ qw(Foo Bar Quux Fleem1 Fleem2) ], 'BUILDs ran in order');