For class_types, explicitly state that the value is not an instance of
[gitmo/Moose.git] / t / 200_examples / 001_example.t
index 33f9058..3488cf0 100644 (file)
@@ -3,12 +3,11 @@
 use strict;
 use warnings;
 
-use Test::More tests => 21;
+use Test::More tests => 22;
 use Test::Exception;
+use Test::Output;
+
 
-BEGIN {
-    use_ok('Moose');           
-}
 
 ## Roles
 
@@ -54,7 +53,9 @@ BEGIN {
     package Constraint::AtLeast;
     use Moose;
 
-    with 'Constraint';
+    ::stderr_is {
+        with 'Constraint' => { excludes => 'error_message' };
+    } "";
 
     sub validate {
         my ($self, $field) = @_;
@@ -66,7 +67,9 @@ BEGIN {
     package Constraint::NoMoreThan;
     use Moose;
 
-    with 'Constraint';
+    ::stderr_is {
+        with 'Constraint' => { excludes => 'error_message' };
+    } '';
 
     sub validate {
         my ($self, $field) = @_;