Skip to content

Instantly share code, notes, and snippets.

@leedo

leedo/Scraper.pm Secret

Created May 13, 2016 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leedo/cc2f52430291aee95c6f8102472e840c to your computer and use it in GitHub Desktop.
Save leedo/cc2f52430291aee95c6f8102472e840c to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl6
use v6;
use Test;
use Web::Scraper;
{
my $scraper = Web::Scraper.new;
isa-ok $scraper, "Web::Scraper";
}
{
isa-ok &scraper, "Code";
}
{
my $scraper = scraper();
isa-ok $scraper, "Web::Scraper";
}
use v6;
class Web::Scraper {
use XML::LibXML::XPathContext:from<Perl5>;
sub scraper() is export {
return Web::Scraper.new;
}
}
laylward@fastlee:~/src/p6-web-scraper (master *)$ perl6 -Ilib t/basic.t
===SORRY!=== Error while compiling /Users/laylward/src/p6-web-scraper/t/basic.t
Undeclared routine:
scraper used at lines 14, 18
ok 1 - The object is-a '"Web::Scraper"'
ok 2 - The object is-a '"Code"'
ok 3 - The object is-a '"Web::Scraper"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment