move Test::Exception to inc/. suggested by autarch++
[gitmo/Mouse.git] / t / 016-trigger.t
index 2925a8e..223e387 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/env perl
 use strict;
 use warnings;
-use Test::More tests => 10;
+use Test::More tests => 11;
 use Test::Exception;
 
 my @trigger;
@@ -20,11 +20,18 @@ do {
     );
 
     ::lives_ok {
-        has error => (
+        has not_error => (
             is => 'ro',
             trigger => sub { },
         );
     } "it's no longer an error to have trigger on a readonly attribute";
+
+    ::throws_ok {
+        has error => (
+            is => 'ro',
+            trigger => [],
+        );
+    } qr/Trigger must be a CODE ref on attribute \(error\)/;
 };
 
 can_ok(Class => 'attr');