From: Stevan Little Date: Thu, 11 May 2006 22:56:46 +0000 (+0000) Subject: foo X-Git-Tag: 0_09_03~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8479d5448574700682ca634dfc7d558d836ed006;p=gitmo%2FMoose.git foo --- diff --git a/t/202_example.t b/t/202_example.t index c9906d6..b68c680 100644 --- a/t/202_example.t +++ b/t/202_example.t @@ -29,7 +29,7 @@ of concept of the flexibility of the ::Instance protocol. BEGIN { - package Newswriter::Meta::Instance; + package Moose::POOP::Meta::Instance; use strict; use warnings; use Moose; @@ -124,7 +124,7 @@ BEGIN { sprintf "%s->{instance}->{%s}", $instance, $slot_name; } - package Newswriter::Meta::Class; + package Moose::POOP::Meta::Class; use strict; use warnings; use Moose; @@ -137,14 +137,14 @@ BEGIN { if $params{oid}; super(); }; -} +} { - package Newswriter::Base; + package Moose::POOP::Object; use strict; use warnings; - use metaclass 'Newswriter::Meta::Class' => ( - ':instance_metaclass' => 'Newswriter::Meta::Instance' + use metaclass 'Moose::POOP::Meta::Class' => ( + ':instance_metaclass' => 'Moose::POOP::Meta::Instance' ); use Moose; @@ -154,13 +154,15 @@ BEGIN { ->get_meta_instance ->get_instance_oid($self); } - + +} +{ package Newswriter::Author; use strict; use warnings; use Moose; - extends 'Newswriter::Base'; + extends 'Moose::POOP::Object'; has 'first_name' => (is => 'rw', isa => 'Str'); has 'last_name' => (is => 'rw', isa => 'Str'); @@ -173,7 +175,7 @@ BEGIN { use DateTime::Format::MySQL; - extends 'Newswriter::Base'; + extends 'Moose::POOP::Object'; subtype 'Headline' => as 'Str' @@ -209,29 +211,29 @@ BEGIN { } { # check the meta stuff first - isa_ok(Newswriter::Base->meta, 'Newswriter::Meta::Class'); - isa_ok(Newswriter::Base->meta, 'Moose::Meta::Class'); - isa_ok(Newswriter::Base->meta, 'Class::MOP::Class'); + isa_ok(Moose::POOP::Object->meta, 'Moose::POOP::Meta::Class'); + isa_ok(Moose::POOP::Object->meta, 'Moose::Meta::Class'); + isa_ok(Moose::POOP::Object->meta, 'Class::MOP::Class'); - is(Newswriter::Base->meta->instance_metaclass, - 'Newswriter::Meta::Instance', + is(Moose::POOP::Object->meta->instance_metaclass, + 'Moose::POOP::Meta::Instance', '... got the right instance metaclass name'); - isa_ok(Newswriter::Base->meta->get_meta_instance, 'Newswriter::Meta::Instance'); + isa_ok(Moose::POOP::Object->meta->get_meta_instance, 'Moose::POOP::Meta::Instance'); - my $base = Newswriter::Base->new; - isa_ok($base, 'Newswriter::Base'); + my $base = Moose::POOP::Object->new; + isa_ok($base, 'Moose::POOP::Object'); isa_ok($base, 'Moose::Object'); - isa_ok($base->meta, 'Newswriter::Meta::Class'); + isa_ok($base->meta, 'Moose::POOP::Meta::Class'); isa_ok($base->meta, 'Moose::Meta::Class'); isa_ok($base->meta, 'Class::MOP::Class'); is($base->meta->instance_metaclass, - 'Newswriter::Meta::Instance', + 'Moose::POOP::Meta::Instance', '... got the right instance metaclass name'); - isa_ok($base->meta->get_meta_instance, 'Newswriter::Meta::Instance'); + isa_ok($base->meta->get_meta_instance, 'Moose::POOP::Meta::Instance'); } my $article_oid; @@ -253,7 +255,7 @@ my $article_ref; ); } '... created my article successfully'; isa_ok($article, 'Newswriter::Article'); - isa_ok($article, 'Newswriter::Base'); + isa_ok($article, 'Moose::POOP::Object'); lives_ok { $article->start_date(DateTime->new(year => 2006, month => 6, day => 10)); @@ -262,15 +264,15 @@ my $article_ref; ## check some meta stuff - isa_ok($article->meta, 'Newswriter::Meta::Class'); + isa_ok($article->meta, 'Moose::POOP::Meta::Class'); isa_ok($article->meta, 'Moose::Meta::Class'); isa_ok($article->meta, 'Class::MOP::Class'); is($article->meta->instance_metaclass, - 'Newswriter::Meta::Instance', + 'Moose::POOP::Meta::Instance', '... got the right instance metaclass name'); - isa_ok($article->meta->get_meta_instance, 'Newswriter::Meta::Instance'); + isa_ok($article->meta->get_meta_instance, 'Moose::POOP::Meta::Instance'); ok($article->oid, '... got a oid for the article'); @@ -295,7 +297,7 @@ my $article_ref; is($article->status, 'pending', '... got the right status'); } -Newswriter::Meta::Instance->_reload_db(); +Moose::POOP::Meta::Instance->_reload_db(); my $article2_oid; my $article2_ref; @@ -316,7 +318,7 @@ my $article2_ref; ); } '... created my article successfully'; isa_ok($article2, 'Newswriter::Article'); - isa_ok($article2, 'Newswriter::Base'); + isa_ok($article2, 'Moose::POOP::Object'); $article2_oid = $article2->oid; $article2_ref = "$article2"; @@ -345,7 +347,7 @@ my $article2_ref; $article = Newswriter::Article->new(oid => $article_oid); } '... (re)-created my article successfully'; isa_ok($article, 'Newswriter::Article'); - isa_ok($article, 'Newswriter::Base'); + isa_ok($article, 'Moose::POOP::Object'); is($article->oid, $article_oid, '... got a oid for the article'); isnt($article_ref, "$article", '... got a new article instance'); @@ -376,7 +378,7 @@ my $article2_ref; is($article->status, 'pending', '... got the right status'); } -Newswriter::Meta::Instance->_reload_db(); +Moose::POOP::Meta::Instance->_reload_db(); { my $article; @@ -384,7 +386,7 @@ Newswriter::Meta::Instance->_reload_db(); $article = Newswriter::Article->new(oid => $article_oid); } '... (re)-created my article successfully'; isa_ok($article, 'Newswriter::Article'); - isa_ok($article, 'Newswriter::Base'); + isa_ok($article, 'Moose::POOP::Object'); is($article->oid, $article_oid, '... got a oid for the article'); isnt($article_ref, "$article", '... got a new article instance'); @@ -411,7 +413,7 @@ Newswriter::Meta::Instance->_reload_db(); $article2 = Newswriter::Article->new(oid => $article2_oid); } '... (re)-created my article successfully'; isa_ok($article2, 'Newswriter::Article'); - isa_ok($article2, 'Newswriter::Base'); + isa_ok($article2, 'Moose::POOP::Object'); is($article2->oid, $article2_oid, '... got a oid for the article'); isnt($article2_ref, "$article2", '... got a new article instance');