Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created August 22, 2014 11:12
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 tadzik/0fe43ae557ab02ff56a0 to your computer and use it in GitHub Desktop.
Save tadzik/0fe43ae557ab02ff56a0 to your computer and use it in GitHub Desktop.
─> g diff|cat
diff --git a/t/09-ua-ssl.t b/t/09-ua-ssl.t
index b49986f..75d0920 100644
--- a/t/09-ua-ssl.t
+++ b/t/09-ua-ssl.t
@@ -12,5 +12,7 @@ my $url = 'https://github.com/';
my $ssl = HTTP::UserAgent.new;
my $get = ~$ssl.get($url);
+say $get;
+
is $get.substr($get.chars - 10), "</html>\n\r\n", 'get 1/1';
# it should definitely have more/better tests
─> perl6 -Ilib t/09-ua-ssl.t
1..2
1..3
ok 1 - 'use HTTP::UserAgent; my $ssl = HTTP::UserAgent.new; $ssl.get("https://filip.sergot.pl")' died
ok 2 - right exception type (X::HTTP::Response)
ok 3 - .message matches Response error: '403 Forbidden'
ok 1 - did we throws_like X::HTTP::Response?
HTTP/1.1 200 OK
Server: GitHub.com
Date: Fri, 22 Aug 2014 11:11:11 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
Status: 200 OK
X-XSS-Protection: 1; mode=block
X-Frame-Options: deny
Content-Security-Policy: default-src *; script-src assets-cdn.github.com www.google-analytics.com collector-cdn.github.com; object-src assets-cdn.github.com; style-src 'self' 'unsafe-inline' 'unsafe-eval' assets-cdn.github.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com collector.githubapp.com *.githubusercontent.com *.gravatar.com *.wp.com; media-src 'none'; frame-src 'self' render.githubusercontent.com www.youtube.com player.vimeo.com checkout.paypal.com; font-src assets-cdn.github.com; connect-src 'self' ghconduit.com:25035 live.github.com uploads.github.com s3.amazonaws.com
Vary: X-PJAX, Accept-Encoding
ETag: "6138651a87ccc1f40a7d24d5e43a549f"
Cache-Control: max-age=0, private, must-revalidate
X-UA-Compatible: IE=Edge, chrome=1
Set-Cookie: logged_in=no; domain=.github.com; path=/; expires=Tue, 22-Aug-2034 11:11:11 GMT; secure; HttpOnly, _gh_sess=eyJzZXNzaW9uX2lkIjoiMzNhYTc3MTU1NjgwNzViOGY5ZTAyMzE4YTg1NmU3YmIiLCJfY3NyZl90b2tlbiI6InJ3YzNRcU1oU0haeEd0bU85ZXVsUXllbHZKNUZWTS9Zektwajk0WG1oRjA9In0%3D--a25fa703de99463ba03a9d181b1ce27c3bcdb856; path=/; secure; HttpOnly
X-Runtime: 0.005805
X-GitHub-Request-Id: C3183284:0876:B94CFFE:53F7254F
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Content-Type-Options: nosniff
X-Served-By: d0e230454cb69aa01d4f86fc3a57b17f
not ok 2 - get 1/1
# Failed test 'get 1/1'
# at lib/Test.pm line 89
# got: '3a57b17f
# '
# expected: '</html>
# '
# Looks like you failed 1 tests of 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment