summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2011-07-11 12:15:04 +0200
committerfranck cuny <franck@lumberjaph.net>2011-07-26 13:21:01 +0200
commit3b4d93fe795ecb77e797a5cfc150db6841795d44 (patch)
treeff34deb279f252459c6a74443e58da1f355db1ac
parentbe explicit when there is a timeout (diff)
downloadnet-http-spore-3b4d93fe795ecb77e797a5cfc150db6841795d44.tar.gz
add test for timeout
Signed-off-by: franck cuny <franck@lumberjaph.net>
-rw-r--r--t/spore-response/timeout.t23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/spore-response/timeout.t b/t/spore-response/timeout.t
new file mode 100644
index 0000000..e7503e6
--- /dev/null
+++ b/t/spore-response/timeout.t
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+use Test::More;
+use Net::HTTP::Spore::Response;
+
+sub res {
+    my $res = Net::HTTP::Spore::Response->new;
+    my %v   = @_;
+    while ( my ( $k, $v ) = each %v ) {
+        $res->$k($v);
+    }
+    $res->to_string;
+}
+
+is(
+    res(
+        status => 500,
+        body   => 'read timeout',
+    ),
+    "HTTP status: 500 - read timeout"
+);
+
+done_testing;