test for hash accessor bug (rt 68837)
[gitmo/Moose.git] / t / native_traits / trait_hash.t
index 107b851..d319ee8 100644 (file)
@@ -292,4 +292,15 @@ sub run_tests {
     $class;
 }
 
+{
+    my ($class, $handles) = build_class(isa => 'HashRef');
+    my $obj = $class->new;
+    with_immutable {
+        is(exception { $obj->option_accessor('foo', undef) }, undef,
+           "can use accessor to set to undef");
+        is(exception { $obj->quantity(undef) }, undef,
+           "can use accessor to set to undef");
+    } $class;
+}
+
 done_testing;