Depend on Net::SSLeay and test on it (and not Crypt::SSLeay), to
[Net-HTTPS-Any.git] / t / get-cryptssleay.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6
7 BEGIN {
8
9   plan skip_all => "LWP tests disabled to avoid excessive dependencies";
10
11   plan( tests=>4 );
12   $Net::HTTPS::Any::skip_NetSSLeay=1;
13   $Net::HTTPS::Any::skip_NetSSLeay=1;
14   use_ok 'Net::HTTPS::Any', 'https_get';
15 };
16
17 #200
18
19 my($content, $response, %headers) = https_get(
20   { 'host' => 'www.fortify.net',
21     'port' => 443,
22     'path' => '/sslcheck.html',
23   },
24   'net_https_any_test' => 1,
25 );
26
27 #like($response, qr/^HTTP\/[\d\.]+\s+200/i, 'Received 200 (OK) response');
28 like($response, qr/^200/i, 'Received 200 (OK) response');
29
30 ok( length($content), 'Received content' );
31
32 #404
33
34 my($content2, $response2, %headers2) = https_get(
35   { 'host' => 'www.fortify.net',
36     'port' => 443,
37     'path' => '/notfound.html',
38   },
39   'net_https_any_test' => 1,
40 );
41
42 #like($response2, qr/^HTTP\/[\d\.]+\s+404/i, 'Received 404 (Not found) response');
43 like($response2, qr/^404/i, 'Received 404 (Not found) response');
44