add debugging, properly export subs
[Net-HTTPS-Any.git] / t / get-netssleay.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6
7 BEGIN {
8  plan( tests=>4 );
9  use_ok( 'Net::HTTPS::Any', qw( https_get ) );
10 }
11
12 #200
13
14 my($content, $response, %headers) = https_get(
15   { 'host' => 'secure.sisd.com',
16     'port' => 443,
17     'path' => '/freeside/index.html',
18   },
19   'net_https_any_test' => 1,
20 );
21
22 like($response, qr/^HTTP\/[\d\.]+\s+200/i, 'Received 200 (OK) response');
23
24 ok( length($content), 'Received content' );
25
26 #404
27
28 my($content2, $response2, %headers2) = https_get(
29   { 'host' => 'secure.sisd.com',
30     'port' => 443,
31     'path' => '/freeside/notfound.html',
32   },
33   'net_https_any_test' => 1,
34 );
35
36 like($response2, qr/^HTTP\/[\d\.]+\s+404/i, 'Received 404 (OK) response');
37