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} }
24 has 'odd1' => (is => 'ro');
25 sub BUILD { push @ran, 'Odd1' }
32 has 'odd3' => (is => 'ro');
33 sub BUILD { push @ran, 'Odd3' }
39 has 'foo' => (is => 'ro');
43 sub BUILD { push @ran, "sub2" }
51 ran => [qw( Foo Bar )],
54 ran => [qw( Foo Bar )],
57 ran => [qw( Foo Bar Quux )],
60 ran => [qw( Foo Bar Quux Fleem1 Fleem2 )],
61 args => [ foo => 'Fleem1', bar => 'Fleem2' ],
70 ran => [qw( Odd1 Odd3 )],
71 args => [ odd1 => 1, odd3 => 3 ],
81 while ( my ($class, $conf) = splice(@tests,0,2) ) {
82 my $o = $class->new( @{ $conf->{args} || [] } );
84 is_deeply(\@ran, $conf->{ran}, 'BUILDs ran in order');