Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a6f734b389
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (23 sloc) 0.643 kb
package TestUtils;
use base 'Exporter';
use vars '@EXPORT';
use File::Path qw(mkpath rmtree);
use Dancer::Request;
use Dancer::Config 'setting';
@EXPORT =
qw(fake_request get_response_for_request);
sub fake_request($$;$) {
my ($method, $path, $params) = @_;
my $req = Dancer::Request->new_for_request($method => $path);
if ($params) {
$req->_set_body_params($params);
}
return $req;
}
sub get_response_for_request {
my ($method, $path, $params) = @_;
my $request = fake_request($method => $path, $params);
Dancer::SharedData->request($request);
Dancer::Renderer::get_action_response();
}
1;
Jump to Line
Something went wrong with that request. Please try again.