added Mouse::Meta::TypeConstraint and use it. Mouse::Meta::Attribute->type_constraint...
[gitmo/Mouse.git] / t / 800_shikabased / 010-isa-or.t
index 0ede006..ef86743 100644 (file)
@@ -14,7 +14,7 @@ use Test::More tests => 18;
 eval {
     Foo->new( bar => +{} );
 };
-ok $@, 'not got an object';
+like($@, qr/^Attribute \(bar\) does not pass the type constraint because: Validation failed for 'Str\|Baz\|Undef' failed with value HASH\(\w+\)/, 'type constraint and coercion failed');
 
 eval {
     isa_ok(Foo->new( bar => undef ), 'Foo');
@@ -32,7 +32,7 @@ my $f = Foo->new;
 eval {
     $f->bar([]);
 };
-ok !$@;
+ok !$@, $@;
 is $f->bar, 'Baz', 'bar is baz (coerce from ArrayRef)';
 
 eval {