summary refs log tree commit diff
path: root/t/spore-response/new.t
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-09-13 13:31:56 +0200
committerfranck cuny <franck@lumberjaph.net>2010-09-13 13:31:56 +0200
commit3e3dc478fc9b4eb90681df89156dfcc8f7f81481 (patch)
treeb9788b0d48f524bc4c0aeeb48c744a8f7b097910 /t/spore-response/new.t
downloadnet-http-spore-3e3dc478fc9b4eb90681df89156dfcc8f7f81481.tar.gz
initial import
Diffstat (limited to '')
-rw-r--r--t/spore-response/new.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/spore-response/new.t b/t/spore-response/new.t
new file mode 100644
index 0000000..fb271ab
--- /dev/null
+++ b/t/spore-response/new.t
@@ -0,0 +1,34 @@
+use strict;
+use warnings;
+use Test::More;
+use Net::HTTP::Spore::Response;
+
+{
+    my $res = Net::HTTP::Spore::Response->new(302);
+        is $res->status, 302;
+        is $res->code, 302;
+}
+
+{
+    my $res = Net::HTTP::Spore::Response->new(200, [ 'Content-Type' => 'text/plain' ]);
+        is $res->content_type, 'text/plain';
+}
+
+{
+    my $res = Net::HTTP::Spore::Response->new(200, { 'Content-Type' => 'text/plain' });
+        is $res->content_type, 'text/plain';
+}
+
+{
+    my $res = Net::HTTP::Spore::Response->new(200);
+        $res->content_type('image/png');
+        is $res->content_type, 'image/png';
+}
+
+{
+    my $res = Net::HTTP::Spore::Response->new(200);
+        $res->header('X-Foo' => "bar");
+        is $res->header('X-Foo'), "bar";
+}
+
+done_testing;