Revert autogenerated tests. Tests should not changed radically.
[gitmo/Mouse.git] / t / 040_type_constraints / failing / 030_class_subtypes.t
@@ -1,13 +1,9 @@
 #!/usr/bin/perl
-# This is automatically generated by author/import-moose-test.pl.
-# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
-use t::lib::MooseCompat;
 
 use strict;
 use warnings;
 
-use Test::More;
-$TODO = q{Mouse is not yet completed};
+use Test::More tests => 26;
 use Test::Exception;
 
 use Mouse::Util::TypeConstraints;
@@ -17,7 +13,7 @@ use Mouse::Meta::TypeConstraint;
 ## Create a subclass with a custom method
 
 {
-    package Test::Mouse::Meta::TypeConstraint;
+    package Test::Mouse::Meta::TypeConstraint::AnySubType;
     use Mouse;
     extends 'Mouse::Meta::TypeConstraint';
 
@@ -27,11 +23,11 @@ use Mouse::Meta::TypeConstraint;
 }
 
 my $Int = find_type_constraint('Int');
-ok $Int, 'Got a good type constraint';
+ok $Int, 'Got a good type contstraint';
 
-my $parent  = Test::Mouse::Meta::TypeConstraint->new({
-        name => "Test::Mouse::Meta::TypeConstraint" ,
-        parent => $Int,
+my $parent  = Test::Mouse::Meta::TypeConstraint::AnySubType->new({
+               name => "Test::Mouse::Meta::TypeConstraint::AnySubType" ,
+               parent => $Int,
 });
 
 ok $parent, 'Created type constraint';
@@ -84,10 +80,10 @@ ok $isa_foo, 'Created subtype of Foo type';
 ok $isa_foo->check( Foo->new ), 'Foo passes check';
 ok $isa_foo->check( Bar->new ), 'Bar passes check';
 ok ! $isa_foo->check( Baz->new ), 'Baz does not pass check';
-like $foo->get_message( Baz->new ), qr/^Validation failed for 'Foo' with value Baz=HASH\(0x\w+\) \(not isa Foo\)/, 'Better validation message';
+like $foo->get_message( Baz->new ), qr/^Validation failed for 'Foo' failed with value Baz=HASH\(0x\w+\) \(not isa Foo\)/, 'Better validation message';
 
 # Maybe in the future this *should* inherit?
-like $isa_foo->get_message( Baz->new ), qr/^Validation failed for 'IsaFoo' with value Baz=HASH\(0x\w+\)$/, "Subtypes do not automatically inherit parent type's message";
+like $isa_foo->get_message( Baz->new ), qr/^Validation failed for 'IsaFoo' failed with value Baz=HASH\(0x\w+\)$/, "Subtypes do not automatically inherit parent type's message";
 
 
 # Implicit types
@@ -104,7 +100,7 @@ like $isa_foo->get_message( Baz->new ), qr/^Validation failed for 'IsaFoo' with
 
 throws_ok {
     Quux->new(age => 3)
-} qr/^Attribute \(age\) does not pass the type constraint because: Validation failed for 'Positive' with value 3 \(not isa Positive\)/;
+} qr/^Attribute \(age\) does not pass the type constraint because: Validation failed for 'Positive' failed with value 3 \(not isa Positive\)/;
 
 lives_ok {
     Quux->new(age => (bless {}, 'Positive'));
@@ -117,7 +113,7 @@ eval "
 
 throws_ok {
     Quux->new(age => 3)
-} qr/^Attribute \(age\) does not pass the type constraint because: Validation failed for 'Positive' with value 3 \(not isa Positive\)/;
+} qr/^Attribute \(age\) does not pass the type constraint because: Validation failed for 'Positive' failed with value 3 \(not isa Positive\)/;
 
 lives_ok {
     Quux->new(age => Positive->new)
@@ -143,5 +139,3 @@ throws_ok {
 lives_ok {
     Quux::Ier->new(age => (bless {}, 'Negative'))
 };
-
-done_testing;