X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FTest.pm;h=815166aee6f3e4661a5ad67381cf668a15bed1b7;hb=4fbc0e853c0b29d1f6082909b0cb54595ea32787;hp=5e0ee163a61bf650d6ab57db1b4665781ab4f034;hpb=269194b4f9de3905430a2d1f21f68da13b2b9ed9;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index 5e0ee16..815166a 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -30,10 +30,10 @@ my $build_exports = sub { my $get = sub { $request->(@_)->content }; - my $crequest = sub { + my $ctx_request = sub { my $me = ref $self || $self; - ### throw an exception if crequest is being used against a remote + ### throw an exception if ctx_request is being used against a remote ### server Catalyst::Exception->throw("$me only works with local requests, not remote") if $ENV{CATALYST_SERVER}; @@ -60,9 +60,9 @@ my $build_exports = sub { }; return { - request => $request, - get => $get, - crequest => $crequest, + request => $request, + get => $get, + ctx_request => $ctx_request, content_like => sub { my $action = shift; return Test::More->builder->like($get->($action),@_); @@ -118,7 +118,7 @@ Catalyst::Test - Test Catalyst Applications use Catalyst::Test 'TestApp'; my $content = get('index.html'); # Content as string my $response = request('index.html'); # HTTP::Response object - my($res, $c) = crequest('index.html'); # HTTP::Response & context object + my($res, $c) = ctx_request('index.html'); # HTTP::Response & context object use HTTP::Request::Common; my $response = request POST '/foo', [ @@ -197,7 +197,7 @@ header configuration; currently only supports setting 'host' value. =head1 FUNCTIONS -=head2 ($res, $c) = crequest( ... ); +=head2 ($res, $c) = ctx_request( ... ); Works exactly like C, except it also returns the catalyst context object, C<$c>. Note that this only works for local requests.