From: Yousef H. Alhashemi Date: Wed, 12 Aug 2009 00:21:41 +0000 (+0000) Subject: Moved action methods from TestAppDoubleAutoBug.pm to a root controller and fixed... X-Git-Tag: 5.80013~12^2~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=cf013d38de7a842c70c9d237a9ee3c18f0a42948 Moved action methods from TestAppDoubleAutoBug.pm to a root controller and fixed the tests. --- diff --git a/t/aggregate/unit_core_action_for.t b/t/aggregate/unit_core_action_for.t index 3e75eaa..c0af9d3 100644 --- a/t/aggregate/unit_core_action_for.t +++ b/t/aggregate/unit_core_action_for.t @@ -12,7 +12,7 @@ plan tests => 4; use_ok('TestApp'); -is(TestApp->action_for('global_action')->code, TestApp->can('global_action'), +is(TestApp->action_for('global_action')->code, TestApp::Controller::Root->can('global_action'), 'action_for on appclass ok'); is(TestApp->controller('Args')->action_for('args')->code, diff --git a/t/custom_live_component_controller_action_auto_doublebug.t b/t/custom_live_component_controller_action_auto_doublebug.t index f5960ef..b1417a0 100644 --- a/t/custom_live_component_controller_action_auto_doublebug.t +++ b/t/custom_live_component_controller_action_auto_doublebug.t @@ -32,9 +32,9 @@ sub run_tests { { my @expected = qw[ - TestAppDoubleAutoBug->auto - TestAppDoubleAutoBug->default - TestAppDoubleAutoBug->end + TestAppDoubleAutoBug::Controller::Root->auto + TestAppDoubleAutoBug::Controller::Root->default + TestAppDoubleAutoBug::Controller::Root->end ]; my $expected = join( ", ", @expected ); diff --git a/t/lib/TestAppDoubleAutoBug.pm b/t/lib/TestAppDoubleAutoBug.pm index 00855cd..82a5e07 100644 --- a/t/lib/TestAppDoubleAutoBug.pm +++ b/t/lib/TestAppDoubleAutoBug.pm @@ -44,16 +44,3 @@ sub execute { return $c->SUPER::execute(@_); } - - - -sub auto : Private { - my ( $self, $c ) = @_; - ++$c->stash->{auto_count}; - return 1; -} - -sub default : Private { - my ( $self, $c ) = @_; - $c->res->body( sprintf 'default, auto=%d', $c->stash->{auto_count} ); -} diff --git a/t/lib/TestAppDoubleAutoBug/Controller/Root.pm b/t/lib/TestAppDoubleAutoBug/Controller/Root.pm new file mode 100644 index 0000000..2d0b1a6 --- /dev/null +++ b/t/lib/TestAppDoubleAutoBug/Controller/Root.pm @@ -0,0 +1,22 @@ +package TestAppDoubleAutoBug::Controller::Root; + +use base 'Catalyst::Controller'; + +__PACKAGE__->config->{namespace} = ''; + +sub auto : Private { + my ( $self, $c ) = @_; + ++$c->stash->{auto_count}; + return 1; +} + +sub default : Private { + my ( $self, $c ) = @_; + $c->res->body( sprintf 'default, auto=%d', $c->stash->{auto_count} ); +} + +sub end : Private { + my ($self,$c) = @_; +} + +1;