[libdancer-plugin-rest-perl] 44/63: fix test, use Dancer::Test

Jonas Smedegaard dr at jones.dk
Wed Jul 2 11:44:53 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 d2e2643554cd05eddb1da364d9993a5d0c597597
Author: Alexis Sukrieh <alexis at weborama.com>
Date:   Fri Mar 4 11:57:56 2011 +0100

    fix test, use Dancer::Test
---
 t/02_prepare_serializer_for_format.t | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/t/02_prepare_serializer_for_format.t b/t/02_prepare_serializer_for_format.t
index 5c8614a..aeb0828 100644
--- a/t/02_prepare_serializer_for_format.t
+++ b/t/02_prepare_serializer_for_format.t
@@ -8,6 +8,7 @@ plan skip_all => "JSON is needed for this test"
 plan skip_all => "YAML is needed for this test"
     unless Dancer::ModuleLoader->load('YAML');
 
+
 my $data = { foo => 42 };
 my $json = JSON::encode_json($data);
 my $yaml = YAML::Dump($data);
@@ -17,6 +18,8 @@ my $yaml = YAML::Dump($data);
     use Dancer;
     use Dancer::Plugin::REST;
 
+    setting environment => 'testing';
+
     prepare_serializer_for_format;
 
     get '/' => sub { "root" };
@@ -24,9 +27,7 @@ my $yaml = YAML::Dump($data);
         $data;
     };
 }
-
-use lib 't';
-use TestUtils;
+use Dancer::Test;
 
 my @tests = (
     {
@@ -54,7 +55,7 @@ my @tests = (
 plan tests => scalar(@tests) * 2;
 
 for my $test ( @tests ) {
-    my $response = get_response_for_request(@{$test->{request}});
+    my $response = dancer_response(@{ $test->{request} });
     is($response->header('Content-Type'), 
        $test->{content_type},
        "headers have content_type set to ".$test->{content_type});

-- 
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