From e53d74d8cdc793874f432748e1ccedc5ab3144e4 Mon Sep 17 00:00:00 2001 From: franck cuny Date: Wed, 24 Nov 2010 12:01:02 +0100 Subject: update tests --- t/spore-middleware/auth-basic.t | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 't/spore-middleware') diff --git a/t/spore-middleware/auth-basic.t b/t/spore-middleware/auth-basic.t index a6c5ac7..cc5ee3e 100644 --- a/t/spore-middleware/auth-basic.t +++ b/t/spore-middleware/auth-basic.t @@ -4,6 +4,7 @@ use warnings; use Test::More; use MIME::Base64; +use Try::Tiny; use Net::HTTP::Spore; my $username = 'franck'; @@ -44,11 +45,15 @@ foreach my $test (@tests) { 't/specs/api.json', base_url => 'http://localhost/' ), 'client created'; + foreach ( @{ $test->{middlewares} } ) { $client->enable(@$_); } - my $res = $client->get_info(); - is $res->[0], $test->{expected}->{status}, 'valid HTTP status'; - is $res->[2], $test->{expected}->{body}, 'valid HTTP body'; + my $res; + + try { $res = $client->get_info(); } catch { $res = $_ }; + + is $res->status, $test->{expected}->{status}, 'valid HTTP status'; + is $res->body, $test->{expected}->{body}, 'valid HTTP body'; } -- cgit 1.4.1