From: Shawn M Moore Date: Sun, 13 Jan 2008 02:57:06 +0000 (+0000) Subject: Fix for the slightly changed rebless_instance interface X-Git-Tag: 0_35~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a415408189a8c3756fd76c4b81d32d5fa25a0d09;p=gitmo%2FMoose.git Fix for the slightly changed rebless_instance interface --- diff --git a/t/010_basics/012_rebless.t b/t/010_basics/012_rebless.t index 8b61297..5ce90bf 100644 --- a/t/010_basics/012_rebless.t +++ b/t/010_basics/012_rebless.t @@ -64,14 +64,14 @@ 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 { $foo->meta->rebless_instance($foo => 'Child') } qr/^Attribute \(type_constrained\) does not pass the type constraint \(Int\) with '10\.5'/; -throws_ok { $bar->meta->rebless_instance($bar => 'Child') } 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 \(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'/; $foo->type_constrained(10); $bar->type_constrained(5); -$foo->meta->rebless_instance($foo => 'Child'); -$bar->meta->rebless_instance($bar => 'Child'); +Child->meta->rebless_instance($foo); +Child->meta->rebless_instance($bar); is(blessed($foo), 'Child', 'successfully reblessed into Child'); is($foo->name, 'Junior', "Child->name's default came through");