00_test_function_download.t 369 B

123456789101112
  1. #!/usr/bin/env perl
  2. use Scrappy;
  3. use FindBin;
  4. use Test::More $ENV{TEST_LIVE} ?
  5. (tests => 2) : (skip_all => 'env var TEST_LIVE not set, live testing is not enabled');
  6. my $s = Scrappy->new;
  7. my $d = "$FindBin::Bin/htdocs";
  8. ok $s->download('http://search.cpan.org/', $d, 'search.cpan.org.html');
  9. ok -f "$d/search.cpan.org.html"; unlink "$d/search.cpan.org.html";