From: Dave Rolsky Date: Sat, 30 Oct 2010 15:07:06 +0000 (-0500) Subject: Revert "Hash accessor should accept more than 2 arguments" X-Git-Tag: 1.18~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5dcac91380949016a8e84cd9eef98186606823f4;p=gitmo%2FMoose.git Revert "Hash accessor should accept more than 2 arguments" This reverts commit 43131ee20ae3d0f9f941ff9c1826cd721449cb3a. Doh, the method is documented as accepting just two arguments. --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm b/lib/Moose/Meta/Method/Accessor/Native/Hash/accessor.pm index 7ebb001..e7348ab 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 {undef} +sub _maximum_arguments {2} no Moose::Role; diff --git a/t/070_native_traits/050_trait_hash.t b/t/070_native_traits/050_trait_hash.t index b7bb837..107b851 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, group => 10 ); + $obj->option_accessor( size => 42 ); like( exception { @@ -187,7 +187,7 @@ sub run_tests { ); is_deeply( - $obj->options, { quantity => 4, size => 42, group => 10 }, + $obj->options, { quantity => 4, size => 42 }, 'accessor as writer' );