X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F010_basics%2F012_rebless.t;fp=t%2F010_basics%2F012_rebless.t;h=fcc5dd63c6485d43e631b06ee01db534594f16e0;hb=688fcdda5c37b86784f8a923b636bdbbf47181d5;hp=5ce90bf253ae4fedba9347f4291359b44993e820;hpb=9edba990401a61d4319cfcf02205186e1713071d;p=gitmo%2FMoose.git diff --git a/t/010_basics/012_rebless.t b/t/010_basics/012_rebless.t index 5ce90bf..fcc5dd6 100644 --- a/t/010_basics/012_rebless.t +++ b/t/010_basics/012_rebless.t @@ -64,8 +64,12 @@ is($foo->lazy_classname, 'Parent', "lazy attribute initialized"); lives_ok { $foo->type_constrained(10.5) } "Num type constraint for now.."; # try to rebless, except it will fail due to Child's stricter type constraint -throws_ok { Child->meta->rebless_instance($foo) } qr/^Attribute \(type_constrained\) does not pass the type constraint \(Int\) with '10\.5'/; -throws_ok { Child->meta->rebless_instance($bar) } qr/^Attribute \(type_constrained\) does not pass the type constraint \(Int\) with '5\.5'/; +throws_ok { Child->meta->rebless_instance($foo) } +qr/^Attribute \(type_constrained\) does not pass the type constraint because\: Validation failed for 'Int' failed with value 10\.5/, +'... this failed cause of type check'; +throws_ok { Child->meta->rebless_instance($bar) } +qr/^Attribute \(type_constrained\) does not pass the type constraint because\: Validation failed for 'Int' failed with value 5\.5/, +'... this failed cause of type check';; $foo->type_constrained(10); $bar->type_constrained(5); @@ -79,4 +83,6 @@ is($foo->name, 'Junior', "Child->name's default came through"); is($foo->lazy_classname, 'Parent', "lazy attribute was already initialized"); is($bar->lazy_classname, 'Child', "lazy attribute just now initialized"); -throws_ok { $foo->type_constrained(10.5) } qr/^Attribute \(type_constrained\) does not pass the type constraint \(Int\) with 10\.5 /; +throws_ok { $foo->type_constrained(10.5) } +qr/^Attribute \(type_constrained\) does not pass the type constraint because\: Validation failed for 'Int' failed with value 10\.5/, +'... this failed cause of type check';