Fix error when no arguments are passed to Hash's accessor method
[gitmo/Moose.git] / t / 070_native_traits / 050_trait_hash.t
index 4ff4671..77bd39a 100644 (file)
@@ -178,6 +178,10 @@ sub run_tests {
 
         $obj->option_accessor( size => 42 );
 
+        like( exception {
+            $obj->option_accessor;
+        }, qr/Cannot call accessor without at least 1 argument/, '... options added okay with defaults' );
+
         is_deeply(
             $obj->options, { quantity => 4, size => 42 },
             'accessor as writer'
@@ -270,7 +274,6 @@ sub run_tests {
                 'kv returns lazy default'
             );
 
-
             $obj->_clear_options;
 
             $obj->option_accessor( y => 2 );