X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F070_native_traits%2F202_trait_array.t;h=fc8500f9d0ed9ed0d9a2566ff53b449f183ef5ba;hb=a28e50e44945358d15eb19e4688573741a319fe0;hp=3d4198351b77d4a2dc4127bc3b628a3644a570b3;hpb=c466e58f62cf93887b29809993bd7830c8350079;p=gitmo%2FMoose.git diff --git a/t/070_native_traits/202_trait_array.t b/t/070_native_traits/202_trait_array.t index 3d41983..fc8500f 100644 --- a/t/070_native_traits/202_trait_array.t +++ b/t/070_native_traits/202_trait_array.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 68; +use Test::More; use Test::Exception; use Test::Moose 'does_ok'; @@ -27,17 +27,17 @@ my $sort; 'get_option_at' => 'get', 'set_option_at' => 'set', 'num_options' => 'count', - 'has_options' => 'empty', + 'has_no_options' => 'is_empty', 'clear_options' => 'clear', 'splice_options' => 'splice', 'sort_options_in_place' => 'sort_in_place', 'option_accessor' => 'accessor', 'add_options_with_speed' => - [ 'push' => [ 'funrolls', 'funbuns' ] ], + [ 'push' => 'funrolls', 'funbuns' ], 'prepend_prerequisites_along_with' => - [ 'unshift' => [ 'first', 'second' ] ], + [ 'unshift' => 'first', 'second' ], 'descending_options' => - [ 'sort_in_place' => [ $sort = sub { $_[1] <=> $_[0] } ] ], + [ 'sort_in_place' => ($sort = sub { $_[1] <=> $_[0] }) ], } ); } @@ -54,14 +54,14 @@ can_ok( $stuff, $_ ) for qw[ set_option_at num_options clear_options - has_options + has_no_options sort_options_in_place option_accessor ]; is_deeply( $stuff->options, [ 10, 12 ], '... got options' ); -ok( $stuff->has_options, '... we have options' ); +ok( !$stuff->has_no_options, '... we have options' ); is( $stuff->num_options, 2, '... got 2 options' ); is( $stuff->remove_last_option, 12, '... removed the last option' ); @@ -69,7 +69,7 @@ is( $stuff->remove_first_option, 10, '... removed the last option' ); is_deeply( $stuff->options, [], '... no options anymore' ); -ok( !$stuff->has_options, '... no options' ); +ok( $stuff->has_no_options, '... no options' ); is( $stuff->num_options, 0, '... got no options' ); lives_ok { @@ -79,7 +79,7 @@ lives_ok { is_deeply( $stuff->options, [ 1, 2, 3 ], '... got options now' ); -ok( $stuff->has_options, '... no options' ); +ok( !$stuff->has_no_options, '... has options' ); is( $stuff->num_options, 3, '... got 3 options' ); is( $stuff->get_option_at(0), 1, '... get option at index 0' ); @@ -255,20 +255,20 @@ is_deeply( 'get_option_at' => 'get', 'set_option_at' => 'set', 'num_options' => 'count', - 'has_options' => 'empty', + 'has_no_options' => 'is_empty', 'clear_options' => 'clear', 'splice_options' => 'splice', 'sort_options_in_place' => 'sort_in_place', 'option_accessor' => 'accessor', - 'add_options_with_speed' => - [ 'push' => [ 'funrolls', 'funbuns' ] ], + 'add_options_with_speed' => [ 'push' => 'funrolls', 'funbuns' ], 'prepend_prerequisites_along_with' => - [ 'unshift' => [ 'first', 'second' ] ], - 'descending_options' => - [ 'sort_in_place' => [$sort] ], + [ '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' ); + +done_testing;