From: Guillermo Roditi Date: Fri, 18 Jul 2008 21:30:29 +0000 (+0000) Subject: feex the tests X-Git-Tag: 0.0008~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6ce00a8fcee743702a9c3f6aaae843ab9847ac3c;p=gitmo%2FMooseX-Object-Pluggable.git feex the tests --- diff --git a/t/01-basic.t b/t/01-basic.t index 4687e91..7025db0 100644 --- a/t/01-basic.t +++ b/t/01-basic.t @@ -5,7 +5,7 @@ use warnings; use Test::More; use lib 't/lib'; -plan tests => 19; +plan tests => 15; use_ok('TestApp'); @@ -17,6 +17,8 @@ is($app->_role_from_plugin('+'.$_), $_) is($app->_role_from_plugin($_), 'TestApp::Plugin::'.$_) for(qw/Foo/); + + is( $app->foo, "original foo", 'original foo value'); is( $app->bar, "original bar", 'original bar value'); is( $app->bor, "original bor", 'original bor value'); @@ -26,13 +28,11 @@ is( $app->bar, "override bar", 'overridden bar via plugin'); ok($app->load_plugin('Baz'), "Loaded Baz"); is( $app->baz, "plugin baz", 'added baz via plugin'); -is( $app->bar, "baz'd bar override bar", 'baz extension for bar using around'); ok($app->load_plugin('Foo'), "Loaded Foo"); is( $app->foo, "around foo", 'around foo via plugin'); -is( $app->bar, "foo'd bar baz'd bar override bar", 'foo extension around baz extension for bar'); -is( $app->baz, "foo'd baz plugin baz", 'foo extension override for baz'); ok($app->load_plugin('+TestApp::Plugin::Bor'), "Loaded Bor"); -is( $app->foo, "bor'd foo around foo", 'bor extension override for foo'); is( $app->bor, "plugin bor", 'override bor via plugin'); + +#print $app->meta->dump(3); diff --git a/t/02-basic2.t b/t/02-basic2.t index 639d20f..382cdc7 100644 --- a/t/02-basic2.t +++ b/t/02-basic2.t @@ -5,7 +5,7 @@ use warnings; use Test::More; use lib 't/lib'; -plan tests => 19; +plan tests => 15; use_ok('TestApp2'); @@ -26,13 +26,9 @@ is( $app->bar, "override bar", 'overridden bar via plugin'); ok($app->load_plugin('Baz'), "Loaded Baz"); is( $app->baz, "plugin baz", 'added baz via plugin'); -is( $app->bar, "baz'd bar override bar", 'baz extension for bar using around'); ok($app->load_plugin('Foo'), "Loaded Foo"); is( $app->foo, "around foo 2", 'around foo via plugin'); -is( $app->bar, "foo'd bar 2 baz'd bar override bar", 'foo extension around baz extension for bar'); -is( $app->baz, "foo'd baz 2 plugin baz", 'foo extension override for baz'); ok($app->load_plugin('+TestApp::Plugin::Bor'), "Loaded Bor"); -is( $app->foo, "bor'd foo around foo 2", 'bor extension override for foo'); is( $app->bor, "plugin bor", 'override bor via plugin'); diff --git a/t/03-custom-ns.t b/t/03-custom-ns.t index 5e4272f..6859661 100644 --- a/t/03-custom-ns.t +++ b/t/03-custom-ns.t @@ -5,7 +5,7 @@ use warnings; use Test::More; use lib 't/lib'; -plan tests => 22; +plan tests => 18; use_ok('TestApp2'); @@ -37,13 +37,9 @@ is( $app->bar, "override bar", 'overridden bar via plugin'); ok($app->load_plugin('Baz'), "Loaded Baz"); is( $app->baz, "plugin baz", 'added baz via plugin'); -is( $app->bar, "baz'd bar override bar", 'baz extension for bar using around'); ok($app->load_plugin('Foo'), "Loaded Foo"); is( $app->foo, "around foo CNS", 'around foo via plugin'); -is( $app->bar, "foo'd bar CNS baz'd bar override bar", 'foo extension around baz extension for bar'); -is( $app->baz, "foo'd baz CNS plugin baz", 'foo extension override for baz'); ok($app->load_plugin('+TestApp::Plugin::Bor'), "Loaded Bor"); -is( $app->foo, "bor'd foo around foo CNS", 'bor extension override for foo'); is( $app->bor, "plugin bor", 'override bor via plugin'); diff --git a/t/lib/CustomNS/Plugin/Foo/ExtensionFor/Bar.pm b/t/lib/CustomNS/Plugin/Foo/ExtensionFor/Bar.pm deleted file mode 100644 index 1c49561..0000000 --- a/t/lib/CustomNS/Plugin/Foo/ExtensionFor/Bar.pm +++ /dev/null @@ -1,12 +0,0 @@ -package CustomNS::Plugin::Foo::ExtensionFor::Bar; - -use strict; -use warnings; -use Moose::Role; - -around bar => sub { - my ($super, $self) = @_; - "foo'd bar CNS " . $super->($self); -}; - -1; diff --git a/t/lib/CustomNS/Plugin/Foo/ExtensionFor/Baz.pm b/t/lib/CustomNS/Plugin/Foo/ExtensionFor/Baz.pm deleted file mode 100644 index aa14429..0000000 --- a/t/lib/CustomNS/Plugin/Foo/ExtensionFor/Baz.pm +++ /dev/null @@ -1,13 +0,0 @@ -package CustomNS::Plugin::Foo::ExtensionFor::Baz; - -use strict; -use warnings; -use Moose::Role; - -around baz => sub{ - my $super = shift; - my $self = shift; - "foo'd baz CNS " . $super->($self); -}; - -1; diff --git a/t/lib/TestApp/Plugin/Baz/ExtensionFor/Bar.pm b/t/lib/TestApp/Plugin/Baz/ExtensionFor/Bar.pm deleted file mode 100644 index eb236ff..0000000 --- a/t/lib/TestApp/Plugin/Baz/ExtensionFor/Bar.pm +++ /dev/null @@ -1,12 +0,0 @@ -package TestApp::Plugin::Baz::ExtensionFor::Bar; - -use strict; -use warnings; -use Moose::Role; - -around bar => sub{ - my ($super, $self) = @_; - "baz'd bar " . $super->($self); -}; - -1; diff --git a/t/lib/TestApp/Plugin/Bor/ExtensionFor/Foo.pm b/t/lib/TestApp/Plugin/Bor/ExtensionFor/Foo.pm deleted file mode 100644 index 15f3379..0000000 --- a/t/lib/TestApp/Plugin/Bor/ExtensionFor/Foo.pm +++ /dev/null @@ -1,13 +0,0 @@ -package TestApp::Plugin::Bor::ExtensionFor::Foo; - -use strict; -use warnings; -use Moose::Role; - -around foo => sub{ - my $super = shift; - my $self = shift; - "bor'd foo " . $super->($self); -}; - -1; diff --git a/t/lib/TestApp/Plugin/Foo/ExtensionFor/Bar.pm b/t/lib/TestApp/Plugin/Foo/ExtensionFor/Bar.pm deleted file mode 100644 index c521441..0000000 --- a/t/lib/TestApp/Plugin/Foo/ExtensionFor/Bar.pm +++ /dev/null @@ -1,12 +0,0 @@ -package TestApp::Plugin::Foo::ExtensionFor::Bar; - -use strict; -use warnings; -use Moose::Role; - -around bar => sub { - my ($super, $self) = @_; - "foo'd bar " . $super->($self); -}; - -1; diff --git a/t/lib/TestApp/Plugin/Foo/ExtensionFor/Baz.pm b/t/lib/TestApp/Plugin/Foo/ExtensionFor/Baz.pm deleted file mode 100644 index f83b96e..0000000 --- a/t/lib/TestApp/Plugin/Foo/ExtensionFor/Baz.pm +++ /dev/null @@ -1,13 +0,0 @@ -package TestApp::Plugin::Foo::ExtensionFor::Baz; - -use strict; -use warnings; -use Moose::Role; - -around baz => sub{ - my $super = shift; - my $self = shift; - "foo'd baz " . $super->($self); -}; - -1; diff --git a/t/lib/TestApp2/Plugin/Foo/ExtensionFor/Bar.pm b/t/lib/TestApp2/Plugin/Foo/ExtensionFor/Bar.pm deleted file mode 100644 index ad67d21..0000000 --- a/t/lib/TestApp2/Plugin/Foo/ExtensionFor/Bar.pm +++ /dev/null @@ -1,12 +0,0 @@ -package TestApp2::Plugin::Foo::ExtensionFor::Bar; - -use strict; -use warnings; -use Moose::Role; - -around bar => sub { - my ($super, $self) = @_; - "foo'd bar 2 " . $super->($self); -}; - -1; diff --git a/t/lib/TestApp2/Plugin/Foo/ExtensionFor/Baz.pm b/t/lib/TestApp2/Plugin/Foo/ExtensionFor/Baz.pm deleted file mode 100644 index 7934fd6..0000000 --- a/t/lib/TestApp2/Plugin/Foo/ExtensionFor/Baz.pm +++ /dev/null @@ -1,13 +0,0 @@ -package TestApp2::Plugin::Foo::ExtensionFor::Baz; - -use strict; -use warnings; -use Moose::Role; - -around baz => sub{ - my $super = shift; - my $self = shift; - "foo'd baz 2 " . $super->($self); -}; - -1;