[Catalyst-commits] r9534 - in Catalyst-Runtime/5.70: . trunk trunk/lib/Catalyst trunk/t

kane at dev.catalyst.perl.org kane at dev.catalyst.perl.org
Fri Mar 20 15:47:40 GMT 2009


Author: kane
Date: 2009-03-20 15:47:40 +0000 (Fri, 20 Mar 2009)
New Revision: 9534

Modified:
   Catalyst-Runtime/5.70/
   Catalyst-Runtime/5.70/trunk/Changes
   Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm
   Catalyst-Runtime/5.70/trunk/t/unit_load_catalyst_test.t
Log:
 r2706 at ds013:  kane | 2009-03-20 16:47:35 +0100
 * rename crequest to ctx_request on request of #cat-dev
   * fix docs & tests
 * add a note in the changelog about it



Property changes on: Catalyst-Runtime/5.70
___________________________________________________________________
Name: svk:merge
   - 6bb30d22-934f-40ac-a2a4-28ad36850c49:/local/cat/Catalyst-Runtime:2663
   + 6bb30d22-934f-40ac-a2a4-28ad36850c49:/local/cat/Catalyst-Runtime:2706

Modified: Catalyst-Runtime/5.70/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.70/trunk/Changes	2009-03-20 14:34:36 UTC (rev 9533)
+++ Catalyst-Runtime/5.70/trunk/Changes	2009-03-20 15:47:40 UTC (rev 9534)
@@ -6,6 +6,8 @@
         - Support Moose components so that attribute defaults work
           and BUILD methods are correctly called (t0m)
           - Add tests for this (Florian Ragwitz)
+        - Added Catalyst::Test::ctx_request to be able to inspect
+          the context object after a request is made (Jos Boumans)
 
 5.71000   2009-01-19 17:50:00
         - Text::SimpleTable's go as wide as $ENV{COLUMNS} (jhannah)

Modified: Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm	2009-03-20 14:34:36 UTC (rev 9533)
+++ Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm	2009-03-20 15:47:40 UTC (rev 9534)
@@ -20,7 +20,7 @@
     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', [
@@ -87,7 +87,7 @@
 
 =head1 FUNCTIONS
 
-=head2 ($res, $c) = crequest( ... );
+=head2 ($res, $c) = ctx_request( ... );
 
 Works exactly like C<Catalyst::Test::request>, except it also returns the
 catalyst context object, C<$c>. Note that this only works for local requests.
@@ -119,12 +119,12 @@
     no strict 'refs';
     my $caller = caller(0);
     
-    *{"$caller\::request"}  = $request;
-    *{"$caller\::get"}      = $get;
-    *{"$caller\::crequest"} = sub { 
+    *{"$caller\::request"}      = $request;
+    *{"$caller\::get"}          = $get;
+    *{"$caller\::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};

Modified: Catalyst-Runtime/5.70/trunk/t/unit_load_catalyst_test.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/unit_load_catalyst_test.t	2009-03-20 14:34:36 UTC (rev 9533)
+++ Catalyst-Runtime/5.70/trunk/t/unit_load_catalyst_test.t	2009-03-20 15:47:40 UTC (rev 9534)
@@ -15,7 +15,7 @@
 my $Content = "root index";
 
 my %Meth    = (
-    $Pkg    => [qw|get request crequest|],          # exported
+    $Pkg    => [qw|get request ctx_request|],       # exported
     $Class  => [qw|local_request remote_request|],  # not exported
 );
 
@@ -62,7 +62,7 @@
     ### test exported methods again
     for my $meth ( @{ $Meth{$Pkg} } ) { SKIP: {
 
-        ### do a call, we should get a result and perhaps a $c if it's 'crequest';
+        ### do a call, we should get a result and perhaps a $c if it's 'ctx_request';
         my ($res, $c) = eval { $Pkg->can($meth)->( $Url ) };
         
         ok( 1,                  "   Called $Pkg->$meth( $Url )" );
@@ -74,8 +74,8 @@
         is( $res_as_string, $Content,
                                 "           Content as expected: $res_as_string" );    
         
-        ### some tests for 'crequest'
-        skip "Context tests skipped for '$meth'", 6 unless $meth eq 'crequest';
+        ### some tests for 'ctx_request'
+        skip "Context tests skipped for '$meth'", 6 unless $meth eq 'ctx_request';
         
         ok( $c,                 "           Context object returned" );
         isa_ok( $c, $App,       "               Object" );




More information about the Catalyst-commits mailing list