[libdancer-plugin-rest-perl] 08/63: TestUtils.pm from Dancer to ease testing reponse

Jonas Smedegaard dr at jones.dk
Wed Jul 2 11:44:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag 0.07
in repository libdancer-plugin-rest-perl.

commit 27f063b2c24434b6da40d94cabcd81917c0d6b97
Author: Alexis Sukrieh <sukria at sukria.net>
Date:   Sat Apr 3 16:53:48 2010 +0200

    TestUtils.pm from Dancer to ease testing reponse
---
 t/TestUtils.pm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/t/TestUtils.pm b/t/TestUtils.pm
new file mode 100644
index 0000000..415f8a5
--- /dev/null
+++ b/t/TestUtils.pm
@@ -0,0 +1,25 @@
+package TestUtils;
+
+use base 'Exporter';
+use vars '@EXPORT';
+
+use File::Path qw(mkpath rmtree);
+use Dancer::Request;
+use Dancer::Config 'setting';
+
+ at EXPORT =
+  qw(fake_request get_response_for_request);
+
+sub fake_request($$) {
+    my ($method, $path) = @_;
+    return Dancer::Request->new_for_request($method => $path);
+}
+
+sub get_response_for_request {
+    my ($method, $path) = @_;
+    my $request = fake_request($method => $path);
+    Dancer::SharedData->request($request);
+    Dancer::Renderer::get_action_response();
+}
+
+1;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdancer-plugin-rest-perl.git



More information about the Pkg-perl-cvs-commits mailing list