X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F070_attribute_helpers%2F202_trait_array.t;h=e4d7fc5fc7366799124f6e432e14a11f264fa0ec;hb=182814510cd4d7ddaf651a9e26fab61d0c0898a1;hp=a84fd5c09f687cb0d416b82108e1482e777c78e3;hpb=5404f169478751c007adfd192e2a42eb1a44206b;p=gitmo%2FMoose.git diff --git a/t/070_attribute_helpers/202_trait_array.t b/t/070_attribute_helpers/202_trait_array.t index a84fd5c..e4d7fc5 100644 --- a/t/070_attribute_helpers/202_trait_array.t +++ b/t/070_attribute_helpers/202_trait_array.t @@ -11,6 +11,7 @@ BEGIN { use_ok('Moose::AttributeHelpers'); } +my $sort; { package Stuff; use Moose; @@ -33,13 +34,12 @@ BEGIN { 'splice_options' => 'splice', 'sort_options_in_place' => 'sort_in_place', 'option_accessor' => 'accessor', - 'add_optons_with_speed' => + 'add_options_with_speed' => [ 'push' => ['funrolls', 'funbuns'] ], 'prepend_prerequisites_along_with' => [ 'unshift' => ['first', 'second'] ], 'descending_options' => - [ 'sort_in_place' => [ sub { $_[1] <=> $_[0] } ] ], - }, + [ 'sort_in_place' => [ $sort = sub { $_[1] <=> $_[0] } ] ], } ); } @@ -224,7 +224,7 @@ dies_ok { my $options = $stuff->meta->get_attribute('options'); does_ok($options, 'Moose::AttributeHelpers::Trait::Collection::Array'); -is_deeply($options->handles, +is_deeply($options->handles, { 'add_options' => 'push', 'remove_last_option' => 'pop', 'remove_first_option' => 'shift', @@ -237,6 +237,12 @@ is_deeply($options->handles, 'splice_options' => 'splice', 'sort_options_in_place' => 'sort_in_place', 'option_accessor' => 'accessor', + 'add_options_with_speed' => + [ 'push' => ['funrolls', 'funbuns'] ], + 'prepend_prerequisites_along_with' => + [ 'unshift' => ['first', 'second'] ], + 'descending_options' => + [ 'sort_in_place' => [ $sort ] ], }, '... got the right handles mapping'); is($options->type_constraint->type_parameter, 'Str', '... got the right container type');