Fix error when array accessor delegation method is called with no arguments
[gitmo/Moose.git] / t / 070_native_traits / 010_trait_array.t
index 3785904..8774ffa 100644 (file)
@@ -227,6 +227,14 @@ sub run_tests {
             is( $obj->accessor( 1 => 97 ), 97, 'accessor returns new value' );
         }, undef, 'accessor as writer lives' );
 
+        like(
+            exception {
+                $obj->accessor;
+            },
+            qr/Cannot call accessor without at least 1 argument/,
+            'throws an error when accessor is called without arguments'
+        );
+
         is(
             $obj->get(1), 97,
             'accessor set value at index 1'