### ----------------------------------------------------
### -- HTTP::UserAgent
### -- Licenses: MIT
### -- Authors: Filip Sergot
### -- File: t/190-issue-116.rakutest
### ----------------------------------------------------
use HTTP::UserAgent;
use Test;

plan 2;

try require ::('IO::Socket::SSL');
if ::('IO::Socket::SSL') ~~ Failure {
    skip-rest("IO::Socket::SSL not available");
    exit 0;
}

unless %*ENV<NETWORK_TESTING> {
  diag "NETWORK_TESTING was not set";
  skip-rest("NETWORK_TESTING was not set");
  exit;
}

my $ua = HTTP::UserAgent.new;

my HTTP::Response $res;
my $request = HTTP::Request.new(GET => 'http://httpbin.org/status/304');
lives-ok { $res = $ua.request($request) }, "another request that always results in 304 lives";
is $res.code , 304, "and it is actually a 304";

# vim: expandtab shiftwidth=4


