Created
June 12, 2009 01:10
-
-
Save imakado/128361 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Test::Base; | |
{ | |
package TestApp; | |
use Ark; | |
package TestApp::Controller::Root; | |
use Ark 'Controller'; | |
__PACKAGE__->config->{namespace} = ''; | |
sub test :Local { | |
my ($self, $c) = @_; | |
my $ret = $c->forward('return_0'); | |
$c->res->body($ret); | |
} | |
sub test2 :Local { | |
my ($self, $c) = @_; | |
my $ret = $c->forward('return_without_arg'); | |
$c->res->body($ret); | |
} | |
sub return_0 :Private { | |
my ($self, $c) = @_; | |
if ( 1 ) { | |
$c->forward('dummy'); | |
return 0; | |
} | |
return 1; | |
} | |
sub return_without_arg :Private { | |
my ($self, $c) = @_; | |
if ( 1 ) { | |
$c->forward('dummy'); | |
return; | |
} | |
return 1; | |
} | |
sub dummy :Private { | |
my ($self, $c) = @_; | |
return 'dummy'; | |
} | |
} | |
use Ark::Test 'TestApp', | |
components => [qw/Controller::Root/], | |
reuse_connection => 1; | |
plan 'no_plan'; | |
is( get('/test'), 0, 'forward to return_0 should return 0'); | |
is( get('/test2'), 0, 'forward return_without_arg should return 0'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment