summaryrefslogtreecommitdiffstats
path: root/t/response-new.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-07-18 16:43:57 -0500
committerJesse Luehrs <doy@tozt.net>2012-07-18 16:43:57 -0500
commitb275579910d410e7f9ecff88cccdeb673191d332 (patch)
treeb1ca4397924ad7a0dd46e9f693edca7eba82a9cf /t/response-new.t
parenta2986198eb809d38bd99e7c56cd80e27ff6394f0 (diff)
downloadweb-request-b275579910d410e7f9ecff88cccdeb673191d332.tar.gz
web-request-b275579910d410e7f9ecff88cccdeb673191d332.zip
import the Plack::Response test suite
Diffstat (limited to 't/response-new.t')
-rw-r--r--t/response-new.t41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/response-new.t b/t/response-new.t
new file mode 100644
index 0000000..d78d1ad
--- /dev/null
+++ b/t/response-new.t
@@ -0,0 +1,41 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Web::Response;
+
+{
+ my $res = Web::Response->new(status => 302);
+ is $res->status, 302;
+}
+
+{
+ my $res = Web::Response->new(
+ status => 200,
+ headers => [ 'Content-Type' => 'text/plain' ],
+ );
+ is $res->content_type, 'text/plain';
+}
+
+{
+ my $res = Web::Response->new(
+ status => 200,
+ headers => { 'Content-Type' => 'text/plain' },
+ );
+ is $res->content_type, 'text/plain';
+}
+
+{
+ my $res = Web::Response->new(status => 200);
+ $res->content_type('image/png');
+ is $res->content_type, 'image/png';
+}
+
+{
+ my $res = Web::Response->new(status => 200);
+ $res->header('X-Foo' => "bar");
+ is $res->header('X-Foo'), "bar";
+}
+
+done_testing;