From: Dave Rolsky Date: Sat, 30 Oct 2010 15:05:23 +0000 (-0500) Subject: Hash accessor should accept more than 2 arguments X-Git-Tag: 1.18~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43131ee20ae3d0f9f941ff9c1826cd721449cb3a;p=gitmo%2FMoose.git Hash accessor should accept more than 2 arguments --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm index e7348ab..7ebb001 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm @@ -75,7 +75,7 @@ sub _generate_method { } sub _minimum_arguments {1} -sub _maximum_arguments {2} +sub _maximum_arguments {undef} no Moose::Role; diff --git a/t/070_native_traits/050_trait_hash.t b/t/070_native_traits/050_trait_hash.t index 107b851..b7bb837 100644 --- a/t/070_native_traits/050_trait_hash.t +++ b/t/070_native_traits/050_trait_hash.t @@ -176,7 +176,7 @@ sub run_tests { '... returns what we expect' ); - $obj->option_accessor( size => 42 ); + $obj->option_accessor( size => 42, group => 10 ); like( exception { @@ -187,7 +187,7 @@ sub run_tests { ); is_deeply( - $obj->options, { quantity => 4, size => 42 }, + $obj->options, { quantity => 4, size => 42, group => 10 }, 'accessor as writer' );