Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (14 sloc) 432 Bytes
use v6;
use Test;
use LWP::Simple;
plan 4;
my $fname = $*SPEC.catdir($*TMPDIR, "./tmp-getstore-$*PID");
try unlink $fname;
ok(
LWP::Simple.getstore('http://www.opera.com', $fname),
'getstore() returned success'
);
my $fh = open($fname);
ok($fh, 'Opened file handle written by getstore()');
ok $fh.slurp-rest ~~ /Opera \s+ browser/, 'Found pattern in downloaded file';
ok(unlink($fname), 'Delete the temporary file');
Something went wrong with that request. Please try again.