Skip to content
This repository

Minor patches #976

Closed
wants to merge 2 commits into from

1 participant

Tom Hukins
Tom Hukins

No description provided.

added some commits December 03, 2013
Tom Hukins Document and trap a limitation in Dancer::Test d1e57ad
Tom Hukins Improve references to related modules
These improvements add references to other documents and remove one
document referring to itself.
6b6170a
Yanick Champoux yanick closed this in 55f1b8f December 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 2 unique commits by 1 author.

Dec 03, 2013
Tom Hukins Document and trap a limitation in Dancer::Test d1e57ad
Tom Hukins Improve references to related modules
These improvements add references to other documents and remove one
document referring to itself.
6b6170a
This page is out of date. Refresh to see the latest.
4  lib/Dancer.pm
@@ -819,7 +819,7 @@ only used to change the method of your request. Use with caution.
819 819
 
820 820
 =head2 from_dumper ($structure)
821 821
 
822  
-Deserializes a Data::Dumper structure.
  822
+Deserializes a L<< Data::Dumper >> structure.
823 823
 
824 824
 =head2 from_json ($structure, %options)
825 825
 
@@ -1759,7 +1759,7 @@ L<Dancer::Template::Abstract> for further details.
1759 1759
 
1760 1760
 =head2 to_dumper ($structure)
1761 1761
 
1762  
-Serializes a structure with Data::Dumper.
  1762
+Serializes a structure with L<< Data::Dumper >>.
1763 1763
 
1764 1764
 =head2 to_json ($structure, %options)
1765 1765
 
2  lib/Dancer/Request.pm
@@ -614,7 +614,7 @@ Dancer::Request - interface for accessing incoming requests
614 614
 =head1 DESCRIPTION
615 615
 
616 616
 This class implements a common interface for accessing incoming requests in
617  
-a Dancer application.
  617
+a L<< Dancer >> application.
618 618
 
619 619
 In a route handler, the current request object can be accessed by the C<request>
620 620
 method, like in the following example:
4  lib/Dancer/Response.pm
@@ -217,7 +217,7 @@ Dancer::Response - Response object for Dancer
217 217
         headers => ['X-Foo' => 'foo-value', 'X-Bar' => 'bar-value'],
218 218
     );
219 219
 
220  
-create and return a new L<Dancer::Response> object
  220
+create and return a new Dancer::Response object
221 221
 
222 222
 =head2 current
223 223
 
@@ -328,6 +328,6 @@ return the list of headers for the current response
328 328
     my $headers_psgi = $response->headers_to_array();
329 329
     my $headers_psgi = Dancer::SharedData->response->headers_to_array();
330 330
 
331  
-this method is called before returning a PSGI response. It transforms the list of headers to an array reference.
  331
+this method is called before returning a L<< PSGI >> response. It transforms the list of headers to an array reference.
332 332
 
333 333
 
2  lib/Dancer/Template.pm
@@ -35,7 +35,7 @@ template engines.
35 35
 
36 36
 =head2 Default engine
37 37
 
38  
-The default engine used by Dancer::Template is Dancer::Template::Simple.
  38
+The default engine used by Dancer::Template is L<< Dancer::Template::Simple >>.
39 39
 If you want to change the engine used, you have to edit the B<template>
40 40
 configuration variable.
41 41
 
4  lib/Dancer/Template/Simple.pm
@@ -164,7 +164,7 @@ Dancer::Template::Simple - pure Perl 5 template engine for Dancer
164 164
 
165 165
 =head1 DESCRIPTION
166 166
 
167  
-This template engine is provided as a default one for the Dancer micro
  167
+This template engine is provided as a default one for the L<< Dancer >> micro
168 168
 framework.
169 169
 
170 170
 This template engine should be fine for development purposes but is not a
@@ -172,7 +172,7 @@ powerful one, it's written in pure Perl and has no C bindings to accelerate the
172 172
 template processing.
173 173
 
174 174
 If you want to power an application with Dancer in production environment, it's
175  
-strongly advised to switch to Dancer::Template::TemplateToolkit.
  175
+strongly advised to switch to L<< Dancer::Template::TemplateToolkit >>.
176 176
 
177 177
 =head1 SYNTAX
178 178
 
13  lib/Dancer/Test.pm
@@ -305,7 +305,11 @@ sub dancer_response {
305 305
 
306 306
         my ($content, $content_type);
307 307
 
308  
-        if ( $args->{body} ) {
  308
+        if ( $args->{body} and $args->{files} ) {
  309
+            # XXX: When fixing this, update this method's POD
  310
+            croak 'dancer_response() does not support both body and files';
  311
+        }
  312
+        elsif ( $args->{body} ) {
309 313
             $content      = $args->{body};
310 314
             $content_type = $args->{content_type}
311 315
                 || 'application/x-www-form-urlencoded';
@@ -584,16 +588,19 @@ location.
584 588
 
585 589
 =head2 dancer_response($method, $path, { params => $params, body => $body, headers => $headers, files => [{filename => '/path/to/file', name => 'my_file'}] })
586 590
 
587  
-Returns a Dancer::Response object for the given request.
  591
+Returns a L<< Dancer::Response >> object for the given request.
588 592
 
589 593
 Only $method and $path are required.
590 594
 
591 595
 $params is a hashref, $body can be a string or a hashref and $headers can be an arrayref or
592  
-a HTTP::Headers object, $files is an arrayref of hashref, containing some files to upload.
  596
+a L<< HTTP::Headers >> object, $files is an arrayref of hashref, containing some files to upload.
593 597
 
594 598
 $params always populates the query string, even for POST requests.  $body
595 599
 always populates the request body.
596 600
 
  601
+Currently, Dancer::Test cannot cope with both I<< body >> and I<< files >>
  602
+passed in the same call.
  603
+
597 604
 A good reason to use this function is for testing POST requests. Since POST
598 605
 requests may not be idempotent, it is necessary to capture the content and
599 606
 status in one shot. Calling the response_status_is and response_content_is
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.