Skip to content

Instantly share code, notes, and snippets.

Created October 4, 2015 19:01
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 anonymous/5fdaad8a37bae71abe8b to your computer and use it in GitHub Desktop.
Save anonymous/5fdaad8a37bae71abe8b to your computer and use it in GitHub Desktop.
[jdv@wieldy p6-http-useragent]$ git diff
diff --git a/t/08-ua.t b/t/08-ua.t
index 96ad494..6c9abab 100644
--- a/t/08-ua.t
+++ b/t/08-ua.t
@@ -5,6 +5,15 @@ use Test;
plan 9;
+IO::Socket::INET.^find_method('recv').wrap( {
+ say "POS:", @_;
+ say "NAMED:", %_;
+ #my \ret = callsame;
+ #say "AFTER";
+ #ret;
+ return callsame;
+} );
+
# new
my $ua = HTTP::UserAgent.new;
nok $ua.useragent, 'new 1/3';
[jdv@wieldy p6-http-useragent]$
[jdv@wieldy p6-http-useragent]$ perl6 -Ilib t/08-ua.t
1..9
ok 1 - new 1/3
ok 2 - new 2/3
ok 3 - new 3/3
POS:[IO::Socket::INET.new(encoding => "utf8", host => "ua.offensivecoder.com", port => 80, localhost => Str, localport => Int, listen => Bool, family => 2, proto => 6, type => 1, input-line-separator => "\n", ins => 0)]
NAMED:bin => True
Internal Error: 'server returned no data'
in method throw at /home/jdv/rakudo/install/share/perl6/runtime/CORE.setting.moarvm:1
in method request at /home/jdv/p6-http-useragent/lib/HTTP/UserAgent.pm6:152
in method get at /home/jdv/p6-http-useragent/lib/HTTP/UserAgent.pm6:87
in method get at /home/jdv/p6-http-useragent/lib/HTTP/UserAgent.pm6:90
in block <unit> at t/08-ua.t:29
# Looks like you planned 9 tests, but ran 3
[jdv@wieldy p6-http-useragent]$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment