Diff of the two buildlogs: -- --- b1/build.log 2025-02-03 06:43:07.831202388 +0000 +++ b2/build.log 2025-02-03 06:47:31.007307863 +0000 @@ -1,6 +1,6 @@ I: pbuilder: network access will be disabled during build -I: Current time: Sun Feb 2 18:40:03 -12 2025 -I: pbuilder-time-stamp: 1738564803 +I: Current time: Mon Feb 3 20:43:17 +14 2025 +I: pbuilder-time-stamp: 1738564997 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/unstable-reproducible-base.tgz] I: copying local configuration @@ -29,52 +29,84 @@ dpkg-source: info: applying 0006-Fix-spec-for-ruby3_3.patch I: Not using root during the build. I: Installing the build-deps -I: user script /srv/workspace/pbuilder/4145/tmp/hooks/D02_print_environment starting +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/D01_modify_environment starting +debug: Running on virt64b. +I: Changing host+domainname to test build reproducibility +I: Adding a custom variable just for the fun of it... +I: Changing /bin/sh to bash +'/bin/sh' -> '/bin/bash' +lrwxrwxrwx 1 root root 9 Feb 3 06:43 /bin/sh -> /bin/bash +I: Setting pbuilder2's login shell to /bin/bash +I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/D01_modify_environment finished +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/D02_print_environment starting I: set - BUILDDIR='/build/reproducible-path' - BUILDUSERGECOS='first user,first room,first work-phone,first home-phone,first other' - BUILDUSERNAME='pbuilder1' - BUILD_ARCH='armhf' - DEBIAN_FRONTEND='noninteractive' - DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=3 ' - DISTRIBUTION='unstable' - HOME='/root' - HOST_ARCH='armhf' + BASH=/bin/sh + BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath + BASH_ALIASES=() + BASH_ARGC=() + BASH_ARGV=() + BASH_CMDS=() + BASH_LINENO=([0]="12" [1]="0") + BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. + BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") + BASH_VERSINFO=([0]="5" [1]="2" [2]="37" [3]="1" [4]="release" [5]="arm-unknown-linux-gnueabihf") + BASH_VERSION='5.2.37(1)-release' + BUILDDIR=/build/reproducible-path + BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' + BUILDUSERNAME=pbuilder2 + BUILD_ARCH=armhf + DEBIAN_FRONTEND=noninteractive + DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=4 ' + DIRSTACK=() + DISTRIBUTION=unstable + EUID=0 + FUNCNAME=([0]="Echo" [1]="main") + GROUPS=() + HOME=/root + HOSTNAME=i-capture-the-hostname + HOSTTYPE=arm + HOST_ARCH=armhf IFS=' ' - INVOCATION_ID='2a7651faac7143cab6896fbc17304bd4' - LANG='C' - LANGUAGE='en_US:en' - LC_ALL='C' - MAIL='/var/mail/root' - OPTIND='1' - PATH='/usr/sbin:/usr/bin:/sbin:/bin:/usr/games' - PBCURRENTCOMMANDLINEOPERATION='build' - PBUILDER_OPERATION='build' - PBUILDER_PKGDATADIR='/usr/share/pbuilder' - PBUILDER_PKGLIBDIR='/usr/lib/pbuilder' - PBUILDER_SYSCONFDIR='/etc' - PPID='4145' - PS1='# ' - PS2='> ' + INVOCATION_ID=bb35798a2f174e0bab10ffbb7367c98d + LANG=C + LANGUAGE=it_CH:it + LC_ALL=C + MACHTYPE=arm-unknown-linux-gnueabihf + MAIL=/var/mail/root + OPTERR=1 + OPTIND=1 + OSTYPE=linux-gnueabihf + PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path + PBCURRENTCOMMANDLINEOPERATION=build + PBUILDER_OPERATION=build + PBUILDER_PKGDATADIR=/usr/share/pbuilder + PBUILDER_PKGLIBDIR=/usr/lib/pbuilder + PBUILDER_SYSCONFDIR=/etc + PIPESTATUS=([0]="0") + POSIXLY_CORRECT=y + PPID=29431 PS4='+ ' - PWD='/' - SHELL='/bin/bash' - SHLVL='2' - SUDO_COMMAND='/usr/bin/timeout -k 18.1h 18h /usr/bin/ionice -c 3 /usr/bin/nice /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.x70vOCWM/pbuilderrc_vfkP --distribution unstable --hookdir /etc/pbuilder/first-build-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.x70vOCWM/b1 --logfile b1/build.log ruby-http_4.4.1-6.dsc' - SUDO_GID='113' - SUDO_UID='107' - SUDO_USER='jenkins' - TERM='unknown' - TZ='/usr/share/zoneinfo/Etc/GMT+12' - USER='root' - _='/usr/bin/systemd-run' - http_proxy='http://10.0.0.15:3142/' + PWD=/ + SHELL=/bin/bash + SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix + SHLVL=3 + SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.x70vOCWM/pbuilderrc_esBv --distribution unstable --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/unstable-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.x70vOCWM/b2 --logfile b2/build.log ruby-http_4.4.1-6.dsc' + SUDO_GID=113 + SUDO_UID=107 + SUDO_USER=jenkins + TERM=unknown + TZ=/usr/share/zoneinfo/Etc/GMT-14 + UID=0 + USER=root + _='I: set' + http_proxy=http://10.0.0.15:3142/ I: uname -a - Linux ff4a 6.1.0-30-armmp-lpae #1 SMP Debian 6.1.124-1 (2025-01-12) armv7l GNU/Linux + Linux i-capture-the-hostname 6.1.0-30-arm64 #1 SMP Debian 6.1.124-1 (2025-01-12) aarch64 GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Nov 22 14:40 /bin -> usr/bin -I: user script /srv/workspace/pbuilder/4145/tmp/hooks/D02_print_environment finished +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy @@ -307,7 +339,7 @@ Get: 173 http://deb.debian.org/debian unstable/main armhf ruby-rspec-mocks all 3.13.0c0e0m0s1-2 [81.3 kB] Get: 174 http://deb.debian.org/debian unstable/main armhf ruby-rspec all 3.13.0c0e0m0s1-2 [5184 B] Get: 175 http://deb.debian.org/debian unstable/main armhf ruby-rspec-its all 1.3.0-1 [6864 B] -Fetched 55.6 MB in 3s (18.4 MB/s) +Fetched 55.6 MB in 2s (25.9 MB/s) Preconfiguring packages ... Selecting previously unselected package libpython3.13-minimal:armhf. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19565 files and directories currently installed.) @@ -883,8 +915,8 @@ Setting up tzdata (2025a-1) ... Current default time zone: 'Etc/UTC' -Local time is now: Mon Feb 3 06:41:46 UTC 2025. -Universal Time is now: Mon Feb 3 06:41:46 UTC 2025. +Local time is now: Mon Feb 3 06:45:42 UTC 2025. +Universal Time is now: Mon Feb 3 06:45:42 UTC 2025. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up ruby-minitest (5.25.4-1) ... @@ -1042,7 +1074,11 @@ Building tag database... -> Finished parsing the build-deps I: Building the package -I: Running cd /build/reproducible-path/ruby-http-4.4.1/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" HOME="/nonexistent/first-build" dpkg-genchanges -S > ../ruby-http_4.4.1-6_source.changes +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/A99_set_merged_usr starting +Not re-configuring usrmerge for unstable +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/A99_set_merged_usr finished +hostname: Name or service not known +I: Running cd /build/reproducible-path/ruby-http-4.4.1/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../ruby-http_4.4.1-6_source.changes dpkg-buildpackage: info: source package ruby-http dpkg-buildpackage: info: source version 4.4.1-6 dpkg-buildpackage: info: source distribution unstable @@ -1142,148 +1178,7 @@ All examples were filtered out; ignoring {:focus=>true} -Randomized with seed 55021 - -HTTP::Response::Parser - whole response in one part - parses headers - parses body - response in many parts - parses headers - parses body - -HTTP::Headers - is Enumerable - #include? - tells whenever given headers is set or not - normalizes given header name - #[] - when header does not exists - returns nil - when header has a multiple values - normalizes header name - returns array of associated values - when header has a single value - normalizes header name - returns it returns a single value - #merge - is expected to be a kind of HTTP::Headers - appends other headers, not presented in base - leaves headers not presented in other as is - is expected not to equal ["Host", "example.com"] and ["Accept", "application/json"] - overwrites existing values - does not affects original headers - #to_h - returns Hash with normalized keys - returns a Hash - for a header with single value - provides a value as is - for a header with multiple values - provides an array of values - #to_a - returns an Array - returns Array of key/value pairs with normalized keys - .empty? - initially - is expected to equal true - when header exists - is expected to equal false - when last header was removed - is expected to equal true - #hash - equals if two headers equals - #inspect - is expected to eq "#[\"hoo=ray\", \"woo=hoo\"]}>" - .coerce - accepts any object that respond to #to_h - accepts any object that respond to #to_a - is aliased as .[] - fails if given object cannot be coerced - accepts any object that respond to #to_hash - with duplicate header keys (mixed case) - adds all headers - #merge! - leaves headers not presented in other as is - overwrites existing values - appends other headers, not presented in base - #each - yields each key/value pair separatedly - yields headers in the same order they were added - returns Enumerator if no block given - returns self instance if block given - #== - sensitive to header values order - sensitive to headers order - compares header keys and values - allows comparison with Array of key/value pairs - #set - allows set multiple values - fails with invalid header name - overwrites previous value - fails with empty header name - sets header value - normalizes header name - #get - returns array of associated values - normalizes header name - fails with invalid header name - fails with empty header name - when header does not exists - returns empty array - #keys - returns uniq keys only - normalizes keys - #dup - is expected to be a kind of HTTP::Headers - is expected not to equal ["Content-Type", "application/json"] - has headers copied - modifying a copy - does not affects original headers - modifies dupped copy - #add - sets header value - allows append multiple values - fails with empty header name - appends new value if header exists - normalizes header name - fails with invalid header name - #delete - fails with empty header name - removes given header - normalizes header name - fails with invalid header name - #[]= - allows set multiple values - sets header value - normalizes header name - overwrites previous value - -HTTP::Options headers - accepts any object that respond to :to_hash - defaults to be empty - may be specified with with_headers - -HTTP::Response::Body - streams bodies from responses - #readpartial - returns content in specified encoding - without size given - does not blows up - calls underlying connection readpartial without specific size - with size given - passes value to underlying connection - when body empty - returns responds to empty? with true - when body is gzipped - decodes body - #readpartial - streams decoded body - -HTTP::Options features - accepts feature name with its options in array - defaults to be empty - raises error for not supported features - accepts plain symbols in array +Randomized with seed 58301 HTTP::Connection #readpartial @@ -1291,1220 +1186,1467 @@ #read_headers! reads data in parts -HTTP::Response - includes HTTP::Headers::Mixin - #connection - returns the connection object used to instantiate the response - #inspect - is expected to eq "#\"text/plain\"}>" - #flush - flushes body - returns response self-reference - #chunked? - is expected not to be chunked - when encoding is set to chunked - is expected to be chunked - #cookies - is expected to be a kind of HTTP::CookieJar - contains cookies limited to domain of request uri - contains cookies without domain restriction - does not contains cookies limited to non-requeted uri - #parse - with known content type - returns parsed body - with explicitly given mime type - ignores mime_type of response - supports MIME type aliases - with unknown content type - raises HTTP::Error - #content_length - with invalid Content-Length - is expected to be nil - with Content-Length: 5 - is expected to eq 5 - without Content-Length header - is expected to be nil - charset - with Content-Type: text/html; charset=utf-8 - is expected to eq "utf-8" - with Content-Type: text/html - is expected to be nil - without Content-Type header - is expected to be nil - mime_type - with Content-Type: text/html; charset=utf-8 - is expected to eq "text/html" - without Content-Type header - is expected to be nil - with Content-Type: text/html - is expected to eq "text/html" - to_a - returns a Rack-like array - -HTTP::Options form - may be specified with with_form_data - defaults to nil - -HTTP::Features::AutoInflate - #wrap_response - when there is no Content-Encoding header - returns original request - for x-gzip Content-Encoding header - returns a HTTP::Response wrapping the inflated response body - for identity Content-Encoding header - returns original request - for gzip Content-Encoding header - returns a HTTP::Response wrapping the inflated response body - when response has uri - preserves uri in wrapped response - for unknown Content-Encoding header - returns original request - for deflate Content-Encoding header - returns a HTTP::Response wrapping the inflated response body +HTTP + unifies socket errors into HTTP::ConnectionError + loading text with no charset + is binary encoded + loading binary data + is encoded as bytes + .timeout + specifying per operation timeouts + sets timeout_class to PerOperation + sets given timeout options + specifying a null timeout + sets timeout_class to Null + specifying a global timeout + sets given timeout option + sets timeout_class to Global + .cookies + properly works with cookie jars from response + properly merges Cookie headers and cookies + passes correct `Cookie` header + properly merges cookies + loading endpoint with charset + uses charset from headers + with encoding option + respects option + getting resources + is easy + with URI instance + is easy + with headers + is easy + with a large request body + with `.timeout(:null)` + writes the whole body + with `.timeout({:read=>2, :write=>2, :connect=>2})` + writes the whole body + with `.timeout(6)` + writes the whole body + with two leading slashes in path + is allowed + with query string parameters + is easy + with query string parameters in the URI and opts hash + includes both + posting forms to resources + is easy + .nodelay + sets TCP_NODELAY on the underlying socket + with redirects + is easy for 302 + is easy for 301 + .auth + accepts any #to_s object + sets Authorization header to the given value + .use + turns on given feature + with :auto_inflate + returns deflated body + returns decoded body + returns raw body when Content-Encoding type is missing + with :normalize_uri + normalizes URI + uses the custom URI Normalizer method + uses the default URI normalizer + with :auto_deflate + sends gzipped body + sends deflated body + .basic_auth + fails when options is not a Hash + fails when :user is not given + fails when :pass is not given + sets Authorization header with proper BasicAuth value + passing a string encoding type + finds encoding + head requests + is easy + posting with an explicit body + is easy + .persistent + with timeout specified + sets keep_alive_timeout + with host only given + example at ./spec/lib/http_spec.rb:260 (PENDING: Temporarily skipped with xit) + example at ./spec/lib/http_spec.rb:261 (PENDING: Temporarily skipped with xit) + with host and block given + returns last evaluation of last expression (PENDING: Temporarily skipped with xit) + auto-closes connection (PENDING: Temporarily skipped with xit) + .via + anonymous proxy + ignores credentials + raises an argument error if no port given + proxies the request + responds with the endpoint's body + ssl + ignores credentials (PENDING: Temporarily skipped with xcontext) + responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) + proxy with authentication + responds with the endpoint's body + proxies the request + responds with 407 if no credentials given + responds with 407 when wrong credentials given + ssl + responds with 407 when wrong credentials given (PENDING: Temporarily skipped with xcontext) + responds with 407 if no credentials given (PENDING: Temporarily skipped with xcontext) + responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) HTTP::Options merge - merges as excepted in complex cases supports a Hash supports another Options + merges as excepted in complex cases -HTTP::Request - provides a #scheme accessor - sets given headers - requires URI to have scheme part - includes HTTP::Headers::Mixin - provides a #verb accessor - User-Agent header - was not given - is expected to eq "http.rb/4.4.1" - was explicitly given - is expected to eq "MrCrawly/123" - #redirect - presets new Host header - with schema-less absolute URL given - presets new Host header - proxy - is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - body - is expected to eq # - uri - is expected to eq # - verb - is expected to eq :post - with relative URL that misses leading slash given - keeps Host header - body - is expected to eq # - with original URI having non-standard port - uri - is expected to eq # - uri - is expected to eq # - proxy - is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - verb - is expected to eq :post - with URL with non-standard port given - presets new Host header - proxy - is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - uri - is expected to eq # - body - is expected to eq # - verb - is expected to eq :post - verb - is expected to eq :post - body - is expected to eq # - uri - is expected to eq # - with new verb given - verb - is expected to equal :get - with relative URL given - keeps Host header - uri - is expected to eq # - verb - is expected to eq :post - proxy - is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - body - is expected to eq # - with original URI having non-standard port - uri - is expected to eq # - proxy - is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - Host header - was explicitly given - is expected to eq "github.com" - was not given - is expected to eq "example.com" - and request URI has non-standard port - is expected to eq "example.com:3000" - #inspect - is expected to eq "#" - #headline - is expected to eq "GET /foo?bar=baz HTTP/1.1" - with proxy - is expected to eq "GET http://example.com/foo?bar=baz HTTP/1.1" - and HTTPS uri - is expected to eq "GET /foo?bar=baz HTTP/1.1" - when URI contains encoded query - does not unencodes query part - when URI contains fragment - omits fragment part - when URI contains non-ASCII path - encodes non-ASCII path part - -HTTP::Options new - supports a Options instance - with a Hash - coerces :response correctly - coerces :proxy correctly - coerces :headers correctly - coerces :form correctly - -HTTP::Features::AutoDeflate - raises error for wrong type - accepts string as method - accepts deflate method - accepts gzip method - uses gzip by default - #deflated_body - when method is deflate - caches compressed content when size is called - returns object which yields deflated content of the given body - when method is gzip - caches compressed content when size is called - returns object which yields gzipped content of the given body - -HTTP::Options body - may be specified with with_body +HTTP::Options json + may be specified with with_json data defaults to nil +HTTP::Options headers + accepts any object that respond to :to_hash + defaults to be empty + may be specified with with_headers + HTTP::Client - without timeouts - works - with a per operation timeout - works - connection - of 1 - does not time out - read - of 0 - times out (PENDING: Temporarily skipped with xit) - of 2.5 - does not time out - following redirects - fails if max amount of hops reached - fails upon endless redirects - prepends previous request uri scheme and host if needed - returns response of new location + passing json + encodes given object + #request + when :auto_deflate was specified + sets Content-Encoding header + deletes Content-Length header + and there is no body + doesn't set Content-Encoding header with non-ASCII URLs - works like a charm in real world (PENDING: Temporarily skipped with xit) theoretically works like a charm (PENDING: Temporarily skipped with xit) - #perform - calls finish_response once body was fully flushed - when server fully flushes response in one chunk - properly reads body - when uses chunked transfer encoding - properly reads body - with broken body (too early closed connection) - raises HTTP::ConnectionError - with HEAD request - does not iterates through body - finishes response after headers were received - with a global timeout - errors if connecting takes too long - errors if reading takes too long - it resets state when reusing connections - does not timeout + works like a charm in real world (PENDING: Temporarily skipped with xit) + with explicitly given `Host` header + keeps `Host` header as is (PENDING: Temporarily skipped with xit) parsing params - combines GET params from the URI with the passed in params - accepts params within the provided URL does not corrupts index-less arrays + combines GET params from the URI with the passed in params + does not modifies query part if no params were given merges duplicate values + accepts params within the provided URL properly encodes colons - does not modifies query part if no params were given does not convert newlines into \r\n before encoding string values + with a global timeout + errors if reading takes too long + errors if connecting takes too long + it resets state when reusing connections + does not timeout working with SSL fails with OpenSSL::SSL::SSLError if host mismatch (PENDING: Temporarily skipped with xdescribe) just works (PENDING: Temporarily skipped with xdescribe) + with a per operation timeout + works (PENDING: Temporarily skipped with xdescribe) + connection + of 1 + does not time out (PENDING: Temporarily skipped with xdescribe) + read + of 0 + times out (PENDING: Temporarily skipped with xit) + of 2.5 + does not time out (PENDING: Temporarily skipped with xdescribe) + without timeouts + works (PENDING: Temporarily skipped with xdescribe) + with a global timeout + errors if connecting takes too long (PENDING: Temporarily skipped with xdescribe) + errors if reading takes too long (PENDING: Temporarily skipped with xdescribe) + it resets state when reusing connections + does not timeout (PENDING: Temporarily skipped with xdescribe) connection reuse + when disabled + opens new sockets (PENDING: Temporarily skipped with xdescribe) when enabled re-uses the socket (PENDING: Temporarily skipped with xdescribe) with a change in host errors (PENDING: Temporarily skipped with xdescribe) with a socket issue transparently reopens (PENDING: Temporarily skipped with xdescribe) + on a mixed state + re-opens the connection (PENDING: Temporarily skipped with xdescribe) when reading a cached body succeeds (PENDING: Temporarily skipped with xdescribe) when trying to read a stale body errors (PENDING: Temporarily skipped with xdescribe) - on a mixed state - re-opens the connection (PENDING: Temporarily skipped with xdescribe) without a host infers host from persistent config (PENDING: Temporarily skipped with xdescribe) - when disabled - opens new sockets (PENDING: Temporarily skipped with xdescribe) with SSL options instead of a context just works (PENDING: Temporarily skipped with xdescribe) - with a global timeout - errors if reading takes too long (PENDING: Temporarily skipped with xdescribe) - errors if connecting takes too long (PENDING: Temporarily skipped with xdescribe) - it resets state when reusing connections - does not timeout (PENDING: Temporarily skipped with xdescribe) - without timeouts - works (PENDING: Temporarily skipped with xdescribe) - with a per operation timeout - works (PENDING: Temporarily skipped with xdescribe) - connection - of 1 - does not time out (PENDING: Temporarily skipped with xdescribe) - read - of 0 - times out (PENDING: Temporarily skipped with xit) - of 2.5 - does not time out (PENDING: Temporarily skipped with xdescribe) - passing json - encodes given object + with a per operation timeout + works + connection + of 1 + does not time out + read + of 2.5 + does not time out + of 0 + times out (PENDING: Temporarily skipped with xit) passing multipart form data - creates multipart form data object creates url encoded form data object + creates multipart form data object when passing an HTTP::FormData object directly creates url encoded form data object + without timeouts + works connection reuse when disabled opens new sockets when enabled re-uses the socket - with a change in host - errors without a host infers host from persistent config + with a socket issue + transparently reopens + with a change in host + errors + when trying to read a stale body + errors on a mixed state re-opens the connection when reading a cached body succeeds - when trying to read a stale body - errors - with a socket issue - transparently reopens - #request - when :auto_deflate was specified - deletes Content-Length header - sets Content-Encoding header - and there is no body - doesn't set Content-Encoding header - with explicitly given `Host` header - keeps `Host` header as is (PENDING: Temporarily skipped with xit) + #perform + calls finish_response once body was fully flushed + with HEAD request + does not iterates through body + finishes response after headers were received + when server fully flushes response in one chunk + properly reads body + when uses chunked transfer encoding + properly reads body + with broken body (too early closed connection) + raises HTTP::ConnectionError + following redirects + prepends previous request uri scheme and host if needed + fails if max amount of hops reached + returns response of new location + fails upon endless redirects with non-ASCII URLs - theoretically works like a charm (PENDING: Temporarily skipped with xit) works like a charm in real world (PENDING: Temporarily skipped with xit) + theoretically works like a charm (PENDING: Temporarily skipped with xit) + +HTTP::Features::Instrumentation + logging the request + should log the request + logging the response + should log the response HTTP::Options has reader methods for attributes coerces to a Hash -HTTP::ContentType - .parse - with text/plain; charset="utf-8" - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain;charset=utf-8;foo=bar - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain; charset=utf-8 - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain; charSET=utf-8 - mime_type - is expected to eq "text/plain" - charset - is expected to eq "utf-8" - with text/plain; foo=bar; charset=utf-8 - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain - mime_type - is expected to eq "text/plain" - charset - is expected to be nil - with tEXT/plaIN - charset - is expected to be nil - mime_type - is expected to eq "text/plain" - -HTTP::URI - knows URI schemes - sets default ports for HTTPS URIs - sets default ports for HTTP URIs +HTTP::Headers + is Enumerable + #keys + returns uniq keys only + normalizes keys + #get + fails with empty header name + fails with invalid header name + normalizes header name + returns array of associated values + when header does not exists + returns empty array + #[] + when header has a multiple values + returns array of associated values + normalizes header name + when header has a single value + returns it returns a single value + normalizes header name + when header does not exists + returns nil + #include? + normalizes given header name + tells whenever given headers is set or not + .coerce + accepts any object that respond to #to_h + is aliased as .[] + fails if given object cannot be coerced + accepts any object that respond to #to_hash + accepts any object that respond to #to_a + with duplicate header keys (mixed case) + adds all headers + #hash + equals if two headers equals + #delete + normalizes header name + removes given header + fails with empty header name + fails with invalid header name + #set + allows set multiple values + normalizes header name + fails with invalid header name + overwrites previous value + fails with empty header name + sets header value #dup - doesn't share internal value between duplicates - -HTTP::Request::Body - #source - returns the original object - #each - when body is an Enumerable IO - allows to enumerate multiple times - yields chunks of content - when body is an Enumerable - yields elements - when body is a non-Enumerable IO - yields chunks of content - when body is a string - yields the string - when body is a pipe - yields chunks of content - when body is nil - yields nothing - #size - when body is an IO with size - returns IO size - when body is a string - returns string bytesize - when body is an IO without size - raises a RequestError - when body is an Enumerable - raises a RequestError - when body is nil - returns zero - #initialize - when body is an Enumerable - does not raise an error - when body is nil - does not raise an error - when body is a string - does not raise an error - when body is an IO - does not raise an error - when body is of unrecognized type - raises an error + is expected to be a kind of HTTP::Headers + is expected not to equal ["Content-Type", "application/json"] + has headers copied + modifying a copy + does not affects original headers + modifies dupped copy + #merge! + overwrites existing values + appends other headers, not presented in base + leaves headers not presented in other as is + #to_h + returns a Hash + returns Hash with normalized keys + for a header with multiple values + provides an array of values + for a header with single value + provides a value as is + #merge + leaves headers not presented in other as is + is expected to be a kind of HTTP::Headers + appends other headers, not presented in base + is expected not to equal ["Host", "example.com"] and ["Accept", "application/json"] + does not affects original headers + overwrites existing values + .empty? + when last header was removed + is expected to equal true + initially + is expected to equal true + when header exists + is expected to equal false + #add + fails with invalid header name + fails with empty header name + appends new value if header exists + normalizes header name + sets header value + allows append multiple values #== - when sources are not equivalent - returns false - when objects are not of the same class - returns false - when sources are equivalent - returns true - -HTTP::Features::Instrumentation - logging the response - should log the response - logging the request - should log the request - -HTTP::Headers::Mixin - #[] - proxies to headers#[] + compares header keys and values + allows comparison with Array of key/value pairs + sensitive to header values order + sensitive to headers order #[]= - proxies to headers#[] - #headers - returns @headers instance variable - -HTTP::Request::Writer - #stream - when multiple headers are set - separates headers with carriage return and line feed - when server won't accept any more data - aborts silently - when Transfer-Encoding is chunked - writes encoded content and omits Content-Length - when Content-Length header is set - keeps the given value - when writing to socket raises an exception - raises a ConnectionError - when body is nonempty - writes it to the socket and sets Content-Length - when body is empty - doesn't write anything to the socket and sets Content-Length + overwrites previous value + allows set multiple values + normalizes header name + sets header value + #to_a + returns an Array + returns Array of key/value pairs with normalized keys + #inspect + is expected to eq "#[\"hoo=ray\", \"woo=hoo\"]}>" + #each + yields headers in the same order they were added + returns self instance if block given + yields each key/value pair separatedly + returns Enumerator if no block given HTTP::Response::Status - #multi_status? - when code is 207 - is expected to equal true - when code is lower than 207 - is expected to equal false - when code is higher than 207 - is expected to equal false - #unprocessable_entity? - when code is lower than 422 + #conflict? + when code is higher than 409 is expected to equal false - when code is 422 + when code is 409 is expected to equal true - when code is higher than 422 - is expected to equal false - #method_not_allowed? - when code is higher than 405 - is expected to equal false - when code is lower than 405 + when code is lower than 409 is expected to equal false - when code is 405 - is expected to equal true - #misdirected_request? - when code is lower than 421 + .new + fails if given value does not respond to #to_i + accepts any object that responds to #to_i + #length_required? + when code is higher than 411 is expected to equal false - when code is 421 + when code is 411 is expected to equal true - when code is higher than 421 + when code is lower than 411 is expected to equal false #not_implemented? - when code is lower than 501 - is expected to equal false when code is 501 is expected to equal true - when code is higher than 501 + when code is lower than 501 is expected to equal false - #see_other? - when code is 303 - is expected to equal true - when code is lower than 303 + when code is higher than 501 is expected to equal false - when code is higher than 303 + #reset_content? + when code is lower than 205 is expected to equal false - #request_header_fields_too_large? - when code is higher than 431 + when code is higher than 205 is expected to equal false - when code is 431 + when code is 205 is expected to equal true - when code is lower than 431 - is expected to equal false - #unauthorized? - when code is lower than 401 + #non_authoritative_information? + when code is higher than 203 is expected to equal false - when code is 401 + when code is 203 is expected to equal true - when code is higher than 401 + when code is lower than 203 is expected to equal false - #network_authentication_required? - when code is lower than 511 + #variant_also_negotiates? + when code is lower than 506 is expected to equal false - when code is higher than 511 + when code is higher than 506 is expected to equal false - when code is 511 + when code is 506 is expected to equal true - #request_timeout? - when code is lower than 408 + with 1xx codes + is #informational? + is not #client_error? + is not #server_error? + is not #redirect? + is not #success? + #forbidden? + when code is 403 + is expected to equal true + when code is higher than 403 is expected to equal false - when code is higher than 408 + when code is lower than 403 is expected to equal false - when code is 408 - is expected to equal true - .coerce - is aliased as `.[]` - fails if coercion failed - with Symbol - fails when symbolized reason is unknown - coerces symbolized reasons - with Numeric - coerces as Fixnum code - with String - coerces reasons - fails when reason is unknown - #not_found? - when code is lower than 404 + #code + is expected to be a kind of Integer + is expected to eq 200 + #reason + with well-known code: 415 + is expected to eq "Unsupported Media Type" + is expected to be frozen + with well-known code: 423 + is expected to eq "Locked" + is expected to be frozen + with well-known code: 307 + is expected to be frozen + is expected to eq "Temporary Redirect" + with unknown code + is expected to be nil + with well-known code: 301 + is expected to eq "Moved Permanently" + is expected to be frozen + with well-known code: 508 + is expected to eq "Loop Detected" + is expected to be frozen + with well-known code: 405 + is expected to eq "Method Not Allowed" + is expected to be frozen + with well-known code: 402 + is expected to be frozen + is expected to eq "Payment Required" + with well-known code: 201 + is expected to be frozen + is expected to eq "Created" + with well-known code: 408 + is expected to be frozen + is expected to eq "Request Timeout" + with well-known code: 422 + is expected to be frozen + is expected to eq "Unprocessable Entity" + with well-known code: 226 + is expected to be frozen + is expected to eq "IM Used" + with well-known code: 426 + is expected to be frozen + is expected to eq "Upgrade Required" + with well-known code: 207 + is expected to be frozen + is expected to eq "Multi-Status" + with well-known code: 203 + is expected to be frozen + is expected to eq "Non-Authoritative Information" + with well-known code: 101 + is expected to be frozen + is expected to eq "Switching Protocols" + with well-known code: 504 + is expected to be frozen + is expected to eq "Gateway Timeout" + with well-known code: 431 + is expected to eq "Request Header Fields Too Large" + is expected to be frozen + with well-known code: 308 + is expected to be frozen + is expected to eq "Permanent Redirect" + with well-known code: 200 + is expected to be frozen + is expected to eq "OK" + with well-known code: 300 + is expected to be frozen + is expected to eq "Multiple Choices" + with well-known code: 404 + is expected to be frozen + is expected to eq "Not Found" + with well-known code: 204 + is expected to be frozen + is expected to eq "No Content" + with well-known code: 302 + is expected to be frozen + is expected to eq "Found" + with well-known code: 429 + is expected to be frozen + is expected to eq "Too Many Requests" + with well-known code: 451 + is expected to be frozen + is expected to eq "Unavailable For Legal Reasons" + with well-known code: 202 + is expected to be frozen + is expected to eq "Accepted" + with well-known code: 424 + is expected to eq "Failed Dependency" + is expected to be frozen + with well-known code: 510 + is expected to be frozen + is expected to eq "Not Extended" + with well-known code: 428 + is expected to be frozen + is expected to eq "Precondition Required" + with well-known code: 501 + is expected to eq "Not Implemented" + is expected to be frozen + with well-known code: 406 + is expected to eq "Not Acceptable" + is expected to be frozen + with well-known code: 102 + is expected to eq "Processing" + is expected to be frozen + with well-known code: 502 + is expected to eq "Bad Gateway" + is expected to be frozen + with well-known code: 409 + is expected to eq "Conflict" + is expected to be frozen + with well-known code: 305 + is expected to eq "Use Proxy" + is expected to be frozen + with well-known code: 421 + is expected to be frozen + is expected to eq "Misdirected Request" + with well-known code: 412 + is expected to be frozen + is expected to eq "Precondition Failed" + with well-known code: 205 + is expected to be frozen + is expected to eq "Reset Content" + with well-known code: 410 + is expected to be frozen + is expected to eq "Gone" + with well-known code: 417 + is expected to eq "Expectation Failed" + is expected to be frozen + with well-known code: 413 + is expected to eq "Payload Too Large" + is expected to be frozen + with well-known code: 208 + is expected to be frozen + is expected to eq "Already Reported" + with well-known code: 416 + is expected to be frozen + is expected to eq "Range Not Satisfiable" + with well-known code: 511 + is expected to be frozen + is expected to eq "Network Authentication Required" + with well-known code: 206 + is expected to eq "Partial Content" + is expected to be frozen + with well-known code: 500 + is expected to eq "Internal Server Error" + is expected to be frozen + with well-known code: 100 + is expected to eq "Continue" + is expected to be frozen + with well-known code: 303 + is expected to be frozen + is expected to eq "See Other" + with well-known code: 506 + is expected to eq "Variant Also Negotiates" + is expected to be frozen + with well-known code: 507 + is expected to eq "Insufficient Storage" + is expected to be frozen + with well-known code: 503 + is expected to be frozen + is expected to eq "Service Unavailable" + with well-known code: 505 + is expected to be frozen + is expected to eq "HTTP Version Not Supported" + with well-known code: 411 + is expected to be frozen + is expected to eq "Length Required" + with well-known code: 304 + is expected to eq "Not Modified" + is expected to be frozen + with well-known code: 403 + is expected to be frozen + is expected to eq "Forbidden" + with well-known code: 400 + is expected to be frozen + is expected to eq "Bad Request" + with well-known code: 401 + is expected to be frozen + is expected to eq "Unauthorized" + with well-known code: 407 + is expected to eq "Proxy Authentication Required" + is expected to be frozen + with well-known code: 414 + is expected to eq "URI Too Long" + is expected to be frozen + #method_not_allowed? + when code is lower than 405 is expected to equal false - when code is higher than 404 + when code is higher than 405 is expected to equal false - when code is 404 + when code is 405 is expected to equal true - #payload_too_large? - when code is 413 + #unavailable_for_legal_reasons? + when code is 451 is expected to equal true - when code is lower than 413 - is expected to equal false - when code is higher than 413 + when code is higher than 451 is expected to equal false - #permanent_redirect? - when code is higher than 308 + when code is lower than 451 is expected to equal false - when code is lower than 308 + #to_sym + with well-known code: 507 + is expected to equal :insufficient_storage + with well-known code: 207 + is expected to equal :multi_status + with well-known code: 422 + is expected to equal :unprocessable_entity + with well-known code: 301 + is expected to equal :moved_permanently + with well-known code: 429 + is expected to equal :too_many_requests + with well-known code: 409 + is expected to equal :conflict + with well-known code: 506 + is expected to equal :variant_also_negotiates + with well-known code: 414 + is expected to equal :uri_too_long + with well-known code: 505 + is expected to equal :http_version_not_supported + with well-known code: 404 + is expected to equal :not_found + with well-known code: 408 + is expected to equal :request_timeout + with well-known code: 421 + is expected to equal :misdirected_request + with well-known code: 226 + is expected to equal :im_used + with well-known code: 400 + is expected to equal :bad_request + with well-known code: 201 + is expected to equal :created + with well-known code: 413 + is expected to equal :payload_too_large + with well-known code: 503 + is expected to equal :service_unavailable + with well-known code: 410 + is expected to equal :gone + with well-known code: 407 + is expected to equal :proxy_authentication_required + with well-known code: 206 + is expected to equal :partial_content + with well-known code: 501 + is expected to equal :not_implemented + with well-known code: 308 + is expected to equal :permanent_redirect + with unknown code + is expected to be nil + with well-known code: 511 + is expected to equal :network_authentication_required + with well-known code: 502 + is expected to equal :bad_gateway + with well-known code: 508 + is expected to equal :loop_detected + with well-known code: 504 + is expected to equal :gateway_timeout + with well-known code: 405 + is expected to equal :method_not_allowed + with well-known code: 403 + is expected to equal :forbidden + with well-known code: 415 + is expected to equal :unsupported_media_type + with well-known code: 424 + is expected to equal :failed_dependency + with well-known code: 305 + is expected to equal :use_proxy + with well-known code: 202 + is expected to equal :accepted + with well-known code: 205 + is expected to equal :reset_content + with well-known code: 451 + is expected to equal :unavailable_for_legal_reasons + with well-known code: 401 + is expected to equal :unauthorized + with well-known code: 411 + is expected to equal :length_required + with well-known code: 307 + is expected to equal :temporary_redirect + with well-known code: 416 + is expected to equal :range_not_satisfiable + with well-known code: 300 + is expected to equal :multiple_choices + with well-known code: 100 + is expected to equal :continue + with well-known code: 406 + is expected to equal :not_acceptable + with well-known code: 304 + is expected to equal :not_modified + with well-known code: 200 + is expected to equal :ok + with well-known code: 204 + is expected to equal :no_content + with well-known code: 510 + is expected to equal :not_extended + with well-known code: 102 + is expected to equal :processing + with well-known code: 431 + is expected to equal :request_header_fields_too_large + with well-known code: 423 + is expected to equal :locked + with well-known code: 428 + is expected to equal :precondition_required + with well-known code: 208 + is expected to equal :already_reported + with well-known code: 426 + is expected to equal :upgrade_required + with well-known code: 500 + is expected to equal :internal_server_error + with well-known code: 402 + is expected to equal :payment_required + with well-known code: 302 + is expected to equal :found + with well-known code: 417 + is expected to equal :expectation_failed + with well-known code: 303 + is expected to equal :see_other + with well-known code: 203 + is expected to equal :non_authoritative_information + with well-known code: 101 + is expected to equal :switching_protocols + with well-known code: 412 + is expected to equal :precondition_failed + #processing? + when code is higher than 102 is expected to equal false - when code is 308 + when code is 102 is expected to equal true - #accepted? - when code is higher than 202 + when code is lower than 102 is expected to equal false - when code is 202 + #no_content? + when code is 204 is expected to equal true - when code is lower than 202 + when code is lower than 204 is expected to equal false - #precondition_failed? - when code is higher than 412 + when code is higher than 204 is expected to equal false - when code is 412 + #continue? + when code is 100 is expected to equal true - when code is lower than 412 + when code is higher than 100 is expected to equal false - #internal_server_error? - when code is 500 - is expected to equal true - when code is higher than 500 + when code is lower than 100 is expected to equal false - when code is lower than 500 + #already_reported? + when code is higher than 208 is expected to equal false - #unavailable_for_legal_reasons? - when code is 451 - is expected to equal true - when code is higher than 451 + when code is lower than 208 is expected to equal false - when code is lower than 451 + when code is 208 + is expected to equal true + #too_many_requests? + when code is 429 + is expected to equal true + when code is lower than 429 is expected to equal false - #variant_also_negotiates? - when code is higher than 506 + when code is higher than 429 is expected to equal false - when code is 506 + #partial_content? + when code is 206 is expected to equal true - when code is lower than 506 + when code is lower than 206 is expected to equal false - #not_acceptable? - when code is 406 - is expected to equal true - when code is lower than 406 + when code is higher than 206 is expected to equal false - when code is higher than 406 + #multi_status? + when code is 207 + is expected to equal true + when code is higher than 207 is expected to equal false - #not_modified? - when code is higher than 304 + when code is lower than 207 is expected to equal false - when code is 304 + #payload_too_large? + when code is 413 is expected to equal true - when code is lower than 304 + when code is higher than 413 is expected to equal false - #already_reported? - when code is 208 - is expected to equal true - when code is lower than 208 + when code is lower than 413 is expected to equal false - when code is higher than 208 + #permanent_redirect? + when code is 308 + is expected to equal true + when code is lower than 308 is expected to equal false - #forbidden? - when code is lower than 403 + when code is higher than 308 is expected to equal false - when code is higher than 403 + #switching_protocols? + when code is lower than 101 is expected to equal false - when code is 403 - is expected to equal true - #precondition_required? - when code is 428 + when code is 101 is expected to equal true - when code is higher than 428 - is expected to equal false - when code is lower than 428 + when code is higher than 101 is expected to equal false - #reset_content? - when code is 205 + #inspect + returns quoted code and reason phrase + #not_found? + when code is 404 is expected to equal true - when code is higher than 205 + when code is lower than 404 is expected to equal false - when code is lower than 205 + when code is higher than 404 is expected to equal false - #range_not_satisfiable? - when code is 416 - is expected to equal true - when code is lower than 416 + #bad_request? + when code is higher than 400 is expected to equal false - when code is higher than 416 + when code is 400 + is expected to equal true + when code is lower than 400 is expected to equal false #created? - when code is lower than 201 - is expected to equal false when code is higher than 201 is expected to equal false when code is 201 is expected to equal true - #not_extended? - when code is lower than 510 + when code is lower than 201 is expected to equal false + #not_extended? when code is 510 is expected to equal true + when code is lower than 510 + is expected to equal false when code is higher than 510 is expected to equal false - #expectation_failed? - when code is higher than 417 + #precondition_failed? + when code is higher than 412 is expected to equal false - when code is lower than 417 + when code is lower than 412 is expected to equal false - when code is 417 + when code is 412 + is expected to equal true + #see_other? + when code is lower than 303 + is expected to equal false + when code is higher than 303 + is expected to equal false + when code is 303 + is expected to equal true + #insufficient_storage? + when code is higher than 507 + is expected to equal false + when code is 507 is expected to equal true + when code is lower than 507 + is expected to equal false with 4xx codes - is not #informational? - is not #success? - is not #server_error? is #client_error? + is not #server_error? + is not #success? is not #redirect? - #conflict? - when code is lower than 409 + is not #informational? + #loop_detected? + when code is lower than 508 is expected to equal false - when code is 409 + when code is 508 is expected to equal true - when code is higher than 409 + when code is higher than 508 is expected to equal false #uri_too_long? + when code is lower than 414 + is expected to equal false when code is higher than 414 is expected to equal false when code is 414 is expected to equal true - when code is lower than 414 + with 3xx codes + is not #informational? + is not #server_error? + is not #client_error? + is #redirect? + is not #success? + #locked? + when code is higher than 423 is expected to equal false - #http_version_not_supported? - when code is lower than 505 + when code is lower than 423 is expected to equal false - when code is 505 + when code is 423 is expected to equal true - when code is higher than 505 + with 2xx codes + is not #server_error? + is not #client_error? + is not #redirect? + is not #informational? + is #success? + #internal_server_error? + when code is 500 + is expected to equal true + when code is lower than 500 + is expected to equal false + when code is higher than 500 + is expected to equal false + #proxy_authentication_required? + when code is higher than 407 + is expected to equal false + when code is 407 + is expected to equal true + when code is lower than 407 is expected to equal false #gateway_timeout? when code is 504 is expected to equal true + when code is lower than 504 + is expected to equal false when code is higher than 504 is expected to equal false - when code is lower than 504 + #ok? + when code is higher than 200 is expected to equal false - #processing? - when code is 102 + when code is 200 is expected to equal true - when code is lower than 102 - is expected to equal false - when code is higher than 102 + when code is lower than 200 is expected to equal false - #moved_permanently? - when code is higher than 301 + #unprocessable_entity? + when code is lower than 422 is expected to equal false - when code is lower than 301 + when code is higher than 422 is expected to equal false - when code is 301 + when code is 422 is expected to equal true - #unsupported_media_type? - when code is lower than 415 + #accepted? + when code is higher than 202 is expected to equal false - when code is 415 + when code is lower than 202 + is expected to equal false + when code is 202 is expected to equal true - when code is higher than 415 + #use_proxy? + when code is lower than 305 is expected to equal false + when code is higher than 305 + is expected to equal false + when code is 305 + is expected to equal true #multiple_choices? when code is higher than 300 is expected to equal false + when code is 300 + is expected to equal true when code is lower than 300 is expected to equal false - when code is 300 + #precondition_required? + when code is higher than 428 + is expected to equal false + when code is lower than 428 + is expected to equal false + when code is 428 is expected to equal true - #bad_request? - when code is 400 + #moved_permanently? + when code is higher than 301 + is expected to equal false + when code is 301 is expected to equal true - when code is higher than 400 + when code is lower than 301 is expected to equal false - when code is lower than 400 + #not_modified? + when code is higher than 304 is expected to equal false - #gone? - when code is lower than 410 + when code is lower than 304 is expected to equal false - when code is higher than 410 + when code is 304 + is expected to equal true + #payment_required? + when code is lower than 402 is expected to equal false - when code is 410 + when code is 402 is expected to equal true - #found? - when code is 302 + when code is higher than 402 + is expected to equal false + #unauthorized? + when code is 401 is expected to equal true - when code is higher than 302 + when code is lower than 401 is expected to equal false - when code is lower than 302 + when code is higher than 401 is expected to equal false - #temporary_redirect? - when code is higher than 307 + #gone? + when code is higher than 410 is expected to equal false - when code is lower than 307 + when code is lower than 410 is expected to equal false - when code is 307 + when code is 410 is expected to equal true - #inspect - returns quoted code and reason phrase - #service_unavailable? - when code is lower than 503 + ::SYMBOLS + [200] + is expected to equal :ok + [400] + is expected to equal :bad_request + #temporary_redirect? + when code is lower than 307 is expected to equal false - when code is higher than 503 + when code is higher than 307 is expected to equal false - when code is 503 - is expected to equal true - #non_authoritative_information? - when code is 203 + when code is 307 is expected to equal true - when code is lower than 203 + #range_not_satisfiable? + when code is lower than 416 is expected to equal false - when code is higher than 203 + when code is 416 + is expected to equal true + when code is higher than 416 is expected to equal false #failed_dependency? - when code is lower than 424 - is expected to equal false when code is higher than 424 is expected to equal false + when code is lower than 424 + is expected to equal false when code is 424 is expected to equal true - #loop_detected? - when code is lower than 508 - is expected to equal false - when code is higher than 508 - is expected to equal false - when code is 508 + #request_timeout? + when code is 408 is expected to equal true - #use_proxy? - when code is higher than 305 + when code is lower than 408 is expected to equal false - when code is lower than 305 + when code is higher than 408 is expected to equal false - when code is 305 - is expected to equal true - #continue? - when code is 100 + #upgrade_required? + when code is 426 is expected to equal true - when code is lower than 100 - is expected to equal false - when code is higher than 100 + when code is lower than 426 is expected to equal false - #im_used? - when code is lower than 226 + when code is higher than 426 is expected to equal false - when code is 226 - is expected to equal true - when code is higher than 226 + #bad_gateway? + when code is higher than 502 is expected to equal false - with 5xx codes - is not #informational? - is not #redirect? - is #server_error? - is not #client_error? - is not #success? - #reason - with well-known code: 424 - is expected to eq "Failed Dependency" - is expected to be frozen - with well-known code: 504 - is expected to eq "Gateway Timeout" - is expected to be frozen - with well-known code: 503 - is expected to eq "Service Unavailable" - is expected to be frozen - with well-known code: 201 - is expected to be frozen - is expected to eq "Created" - with well-known code: 403 - is expected to eq "Forbidden" - is expected to be frozen - with well-known code: 426 - is expected to be frozen - is expected to eq "Upgrade Required" - with well-known code: 404 - is expected to eq "Not Found" - is expected to be frozen - with well-known code: 400 - is expected to be frozen - is expected to eq "Bad Request" - with well-known code: 409 - is expected to be frozen - is expected to eq "Conflict" - with well-known code: 507 - is expected to eq "Insufficient Storage" - is expected to be frozen - with well-known code: 407 - is expected to eq "Proxy Authentication Required" - is expected to be frozen - with well-known code: 208 - is expected to eq "Already Reported" - is expected to be frozen - with well-known code: 202 - is expected to eq "Accepted" - is expected to be frozen - with well-known code: 500 - is expected to eq "Internal Server Error" - is expected to be frozen - with well-known code: 410 - is expected to eq "Gone" - is expected to be frozen - with well-known code: 206 - is expected to be frozen - is expected to eq "Partial Content" - with well-known code: 511 - is expected to eq "Network Authentication Required" - is expected to be frozen - with well-known code: 421 - is expected to eq "Misdirected Request" - is expected to be frozen - with well-known code: 203 - is expected to be frozen - is expected to eq "Non-Authoritative Information" - with well-known code: 505 - is expected to eq "HTTP Version Not Supported" - is expected to be frozen - with well-known code: 307 - is expected to eq "Temporary Redirect" - is expected to be frozen - with well-known code: 408 - is expected to be frozen - is expected to eq "Request Timeout" - with unknown code - is expected to be nil - with well-known code: 301 - is expected to be frozen - is expected to eq "Moved Permanently" - with well-known code: 501 - is expected to be frozen - is expected to eq "Not Implemented" - with well-known code: 207 - is expected to eq "Multi-Status" - is expected to be frozen - with well-known code: 402 - is expected to be frozen - is expected to eq "Payment Required" - with well-known code: 405 - is expected to be frozen - is expected to eq "Method Not Allowed" - with well-known code: 401 - is expected to eq "Unauthorized" - is expected to be frozen - with well-known code: 423 - is expected to be frozen - is expected to eq "Locked" - with well-known code: 506 - is expected to be frozen - is expected to eq "Variant Also Negotiates" - with well-known code: 413 - is expected to eq "Payload Too Large" - is expected to be frozen - with well-known code: 406 - is expected to eq "Not Acceptable" - is expected to be frozen - with well-known code: 300 - is expected to eq "Multiple Choices" - is expected to be frozen - with well-known code: 205 - is expected to eq "Reset Content" - is expected to be frozen - with well-known code: 416 - is expected to be frozen - is expected to eq "Range Not Satisfiable" - with well-known code: 303 - is expected to eq "See Other" - is expected to be frozen - with well-known code: 508 - is expected to be frozen - is expected to eq "Loop Detected" - with well-known code: 422 - is expected to eq "Unprocessable Entity" - is expected to be frozen - with well-known code: 305 - is expected to eq "Use Proxy" - is expected to be frozen - with well-known code: 502 - is expected to eq "Bad Gateway" - is expected to be frozen - with well-known code: 102 - is expected to eq "Processing" - is expected to be frozen - with well-known code: 226 - is expected to be frozen - is expected to eq "IM Used" - with well-known code: 428 - is expected to be frozen - is expected to eq "Precondition Required" - with well-known code: 417 - is expected to eq "Expectation Failed" - is expected to be frozen - with well-known code: 308 - is expected to be frozen - is expected to eq "Permanent Redirect" - with well-known code: 200 - is expected to eq "OK" - is expected to be frozen - with well-known code: 415 - is expected to be frozen - is expected to eq "Unsupported Media Type" - with well-known code: 414 - is expected to be frozen - is expected to eq "URI Too Long" - with well-known code: 429 - is expected to be frozen - is expected to eq "Too Many Requests" - with well-known code: 304 - is expected to be frozen - is expected to eq "Not Modified" - with well-known code: 412 - is expected to be frozen - is expected to eq "Precondition Failed" - with well-known code: 204 - is expected to be frozen - is expected to eq "No Content" - with well-known code: 100 - is expected to eq "Continue" - is expected to be frozen - with well-known code: 101 - is expected to eq "Switching Protocols" - is expected to be frozen - with well-known code: 451 - is expected to be frozen - is expected to eq "Unavailable For Legal Reasons" - with well-known code: 431 - is expected to eq "Request Header Fields Too Large" - is expected to be frozen - with well-known code: 411 - is expected to be frozen - is expected to eq "Length Required" - with well-known code: 302 - is expected to be frozen - is expected to eq "Found" - with well-known code: 510 - is expected to eq "Not Extended" - is expected to be frozen - #partial_content? - when code is 206 + when code is 502 is expected to equal true - when code is lower than 206 + when code is lower than 502 is expected to equal false - when code is higher than 206 + #expectation_failed? + when code is higher than 417 is expected to equal false - with 1xx codes - is not #redirect? - is #informational? - is not #client_error? - is not #server_error? - is not #success? - #locked? - when code is 423 + when code is 417 is expected to equal true - when code is higher than 423 - is expected to equal false - when code is lower than 423 + when code is lower than 417 is expected to equal false - #proxy_authentication_required? - when code is higher than 407 + #im_used? + when code is higher than 226 is expected to equal false - when code is lower than 407 + when code is lower than 226 is expected to equal false - when code is 407 + when code is 226 is expected to equal true - #no_content? - when code is lower than 204 - is expected to equal false - when code is higher than 204 + .coerce + is aliased as `.[]` + fails if coercion failed + with Numeric + coerces as Fixnum code + with String + fails when reason is unknown + coerces reasons + with Symbol + coerces symbolized reasons + fails when symbolized reason is unknown + #http_version_not_supported? + when code is lower than 505 is expected to equal false - when code is 204 - is expected to equal true - .new - fails if given value does not respond to #to_i - accepts any object that responds to #to_i - ::SYMBOLS - [400] - is expected to equal :bad_request - [200] - is expected to equal :ok - #too_many_requests? - when code is 429 + when code is 505 is expected to equal true - when code is higher than 429 + when code is higher than 505 is expected to equal false - when code is lower than 429 + #found? + when code is higher than 302 is expected to equal false - with 3xx codes - is not #client_error? - is not #success? - is not #server_error? - is not #informational? - is #redirect? - #bad_gateway? - when code is 502 + when code is 302 is expected to equal true - when code is higher than 502 - is expected to equal false - when code is lower than 502 + when code is lower than 302 is expected to equal false - with 2xx codes - is not #redirect? - is not #informational? - is #success? - is not #server_error? - is not #client_error? - #insufficient_storage? - when code is higher than 507 + #misdirected_request? + when code is lower than 421 is expected to equal false - when code is lower than 507 + when code is higher than 421 is expected to equal false - when code is 507 + when code is 421 is expected to equal true - #payment_required? - when code is 402 + #network_authentication_required? + when code is 511 is expected to equal true - when code is higher than 402 + when code is lower than 511 is expected to equal false - when code is lower than 402 + when code is higher than 511 is expected to equal false - #ok? - when code is lower than 200 + #service_unavailable? + when code is lower than 503 is expected to equal false - when code is 200 + when code is 503 is expected to equal true - when code is higher than 200 + when code is higher than 503 is expected to equal false - #upgrade_required? - when code is 426 - is expected to equal true - when code is higher than 426 + with 5xx codes + is not #redirect? + is not #success? + is not #client_error? + is #server_error? + is not #informational? + #not_acceptable? + when code is lower than 406 is expected to equal false - when code is lower than 426 + when code is higher than 406 is expected to equal false - #to_sym - with well-known code: 508 - is expected to equal :loop_detected - with well-known code: 426 - is expected to equal :upgrade_required - with well-known code: 511 - is expected to equal :network_authentication_required - with well-known code: 423 - is expected to equal :locked - with well-known code: 301 - is expected to equal :moved_permanently - with well-known code: 201 - is expected to equal :created - with well-known code: 417 - is expected to equal :expectation_failed - with well-known code: 403 - is expected to equal :forbidden - with well-known code: 413 - is expected to equal :payload_too_large - with well-known code: 422 - is expected to equal :unprocessable_entity - with well-known code: 421 - is expected to equal :misdirected_request - with well-known code: 407 - is expected to equal :proxy_authentication_required - with well-known code: 302 - is expected to equal :found - with well-known code: 308 - is expected to equal :permanent_redirect - with well-known code: 206 - is expected to equal :partial_content - with well-known code: 412 - is expected to equal :precondition_failed - with well-known code: 409 - is expected to equal :conflict - with well-known code: 507 - is expected to equal :insufficient_storage - with well-known code: 416 - is expected to equal :range_not_satisfiable - with well-known code: 207 - is expected to equal :multi_status - with well-known code: 402 - is expected to equal :payment_required - with well-known code: 415 - is expected to equal :unsupported_media_type - with well-known code: 510 - is expected to equal :not_extended - with well-known code: 451 - is expected to equal :unavailable_for_legal_reasons - with well-known code: 503 - is expected to equal :service_unavailable - with well-known code: 504 - is expected to equal :gateway_timeout - with well-known code: 411 - is expected to equal :length_required - with well-known code: 202 - is expected to equal :accepted - with well-known code: 414 - is expected to equal :uri_too_long - with well-known code: 300 - is expected to equal :multiple_choices - with well-known code: 428 - is expected to equal :precondition_required - with well-known code: 204 - is expected to equal :no_content - with well-known code: 408 - is expected to equal :request_timeout - with well-known code: 404 - is expected to equal :not_found - with well-known code: 405 - is expected to equal :method_not_allowed - with well-known code: 100 - is expected to equal :continue - with unknown code - is expected to be nil - with well-known code: 500 - is expected to equal :internal_server_error - with well-known code: 307 - is expected to equal :temporary_redirect - with well-known code: 401 - is expected to equal :unauthorized - with well-known code: 429 - is expected to equal :too_many_requests - with well-known code: 505 - is expected to equal :http_version_not_supported - with well-known code: 208 - is expected to equal :already_reported - with well-known code: 205 - is expected to equal :reset_content - with well-known code: 501 - is expected to equal :not_implemented - with well-known code: 406 - is expected to equal :not_acceptable - with well-known code: 226 - is expected to equal :im_used - with well-known code: 502 - is expected to equal :bad_gateway - with well-known code: 304 - is expected to equal :not_modified - with well-known code: 424 - is expected to equal :failed_dependency - with well-known code: 101 - is expected to equal :switching_protocols - with well-known code: 303 - is expected to equal :see_other - with well-known code: 203 - is expected to equal :non_authoritative_information - with well-known code: 431 - is expected to equal :request_header_fields_too_large - with well-known code: 102 - is expected to equal :processing - with well-known code: 410 - is expected to equal :gone - with well-known code: 305 - is expected to equal :use_proxy - with well-known code: 400 - is expected to equal :bad_request - with well-known code: 200 - is expected to equal :ok - with well-known code: 506 - is expected to equal :variant_also_negotiates - #length_required? - when code is 411 + when code is 406 is expected to equal true - when code is lower than 411 + #unsupported_media_type? + when code is higher than 415 is expected to equal false - when code is higher than 411 + when code is lower than 415 is expected to equal false - #code - is expected to be a kind of Integer - is expected to eq 200 - #switching_protocols? - when code is lower than 101 + when code is 415 + is expected to equal true + #request_header_fields_too_large? + when code is lower than 431 is expected to equal false - when code is higher than 101 + when code is higher than 431 is expected to equal false - when code is 101 + when code is 431 is expected to equal true -HTTP::Options json - may be specified with with_json data +HTTP::URI + sets default ports for HTTP URIs + sets default ports for HTTPS URIs + knows URI schemes + #dup + doesn't share internal value between duplicates + +HTTP::Response::Parser + whole response in one part + parses headers + parses body + response in many parts + parses headers + parses body + +HTTP::Request::Body + #source + returns the original object + #each + when body is a string + yields the string + when body is a pipe + yields chunks of content + when body is an Enumerable IO + allows to enumerate multiple times + yields chunks of content + when body is nil + yields nothing + when body is a non-Enumerable IO + yields chunks of content + when body is an Enumerable + yields elements + #size + when body is an IO with size + returns IO size + when body is a string + returns string bytesize + when body is an Enumerable + raises a RequestError + when body is nil + returns zero + when body is an IO without size + raises a RequestError + #== + when objects are not of the same class + returns false + when sources are equivalent + returns true + when sources are not equivalent + returns false + #initialize + when body is an Enumerable + does not raise an error + when body is a string + does not raise an error + when body is of unrecognized type + raises an error + when body is an IO + does not raise an error + when body is nil + does not raise an error + +HTTP::ContentType + .parse + with text/plain; foo=bar; charset=utf-8 + mime_type + is expected to eq "text/plain" + charset + is expected to eq "utf-8" + with text/plain; charSET=utf-8 + mime_type + is expected to eq "text/plain" + charset + is expected to eq "utf-8" + with text/plain; charset="utf-8" + mime_type + is expected to eq "text/plain" + charset + is expected to eq "utf-8" + with text/plain; charset=utf-8 + charset + is expected to eq "utf-8" + mime_type + is expected to eq "text/plain" + with text/plain + mime_type + is expected to eq "text/plain" + charset + is expected to be nil + with text/plain;charset=utf-8;foo=bar + mime_type + is expected to eq "text/plain" + charset + is expected to eq "utf-8" + with tEXT/plaIN + charset + is expected to be nil + mime_type + is expected to eq "text/plain" + +HTTP::Options new + supports a Options instance + with a Hash + coerces :response correctly + coerces :form correctly + coerces :proxy correctly + coerces :headers correctly + +HTTP::Request::Writer + #stream + when multiple headers are set + separates headers with carriage return and line feed + when body is nonempty + writes it to the socket and sets Content-Length + when Transfer-Encoding is chunked + writes encoded content and omits Content-Length + when body is empty + doesn't write anything to the socket and sets Content-Length + when server won't accept any more data + aborts silently + when Content-Length header is set + keeps the given value + when writing to socket raises an exception + raises a ConnectionError + +HTTP::Features::AutoDeflate + accepts string as method + accepts gzip method + accepts deflate method + raises error for wrong type + uses gzip by default + #deflated_body + when method is deflate + returns object which yields deflated content of the given body + caches compressed content when size is called + when method is gzip + caches compressed content when size is called + returns object which yields gzipped content of the given body + +HTTP::Features::AutoInflate + #wrap_response + for unknown Content-Encoding header + returns original request + for gzip Content-Encoding header + returns a HTTP::Response wrapping the inflated response body + when there is no Content-Encoding header + returns original request + for identity Content-Encoding header + returns original request + when response has uri + preserves uri in wrapped response + for deflate Content-Encoding header + returns a HTTP::Response wrapping the inflated response body + for x-gzip Content-Encoding header + returns a HTTP::Response wrapping the inflated response body + +HTTP::Request + includes HTTP::Headers::Mixin + sets given headers + requires URI to have scheme part + provides a #verb accessor + provides a #scheme accessor + #redirect + presets new Host header + with relative URL given + keeps Host header + body + is expected to eq # + uri + is expected to eq # + verb + is expected to eq :post + proxy + is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} + with original URI having non-standard port + uri + is expected to eq # + with schema-less absolute URL given + presets new Host header + proxy + is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} + body + is expected to eq # + verb + is expected to eq :post + uri + is expected to eq # + verb + is expected to eq :post + with URL with non-standard port given + presets new Host header + proxy + is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} + body + is expected to eq # + uri + is expected to eq # + verb + is expected to eq :post + with relative URL that misses leading slash given + keeps Host header + with original URI having non-standard port + uri + is expected to eq # + uri + is expected to eq # + verb + is expected to eq :post + proxy + is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} + body + is expected to eq # + proxy + is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} + with new verb given + verb + is expected to equal :get + body + is expected to eq # + uri + is expected to eq # + #headline + is expected to eq "GET /foo?bar=baz HTTP/1.1" + when URI contains non-ASCII path + encodes non-ASCII path part + when URI contains fragment + omits fragment part + when URI contains encoded query + does not unencodes query part + with proxy + is expected to eq "GET http://example.com/foo?bar=baz HTTP/1.1" + and HTTPS uri + is expected to eq "GET /foo?bar=baz HTTP/1.1" + Host header + was explicitly given + is expected to eq "github.com" + was not given + is expected to eq "example.com" + and request URI has non-standard port + is expected to eq "example.com:3000" + #inspect + is expected to eq "#" + User-Agent header + was explicitly given + is expected to eq "MrCrawly/123" + was not given + is expected to eq "http.rb/4.4.1" + +HTTP::Response::Body + streams bodies from responses + when body empty + returns responds to empty? with true + #readpartial + returns content in specified encoding + with size given + passes value to underlying connection + without size given + does not blows up + calls underlying connection readpartial without specific size + when body is gzipped + decodes body + #readpartial + streams decoded body + +HTTP::Options proxy + accepts proxy address, port, username, and password + may be specified with with_proxy + defaults to {} + +HTTP::Response + includes HTTP::Headers::Mixin + #inspect + is expected to eq "#\"text/plain\"}>" + #connection + returns the connection object used to instantiate the response + charset + without Content-Type header + is expected to be nil + with Content-Type: text/html; charset=utf-8 + is expected to eq "utf-8" + with Content-Type: text/html + is expected to be nil + #cookies + does not contains cookies limited to non-requeted uri + is expected to be a kind of HTTP::CookieJar + contains cookies without domain restriction + contains cookies limited to domain of request uri + #flush + flushes body + returns response self-reference + #content_length + without Content-Length header + is expected to be nil + with Content-Length: 5 + is expected to eq 5 + with invalid Content-Length + is expected to be nil + #chunked? + is expected not to be chunked + when encoding is set to chunked + is expected to be chunked + to_a + returns a Rack-like array + mime_type + with Content-Type: text/html; charset=utf-8 + is expected to eq "text/html" + with Content-Type: text/html + is expected to eq "text/html" + without Content-Type header + is expected to be nil + #parse + with unknown content type + raises HTTP::Error + with explicitly given mime type + ignores mime_type of response + supports MIME type aliases + with known content type + returns parsed body + +HTTP::Headers::Mixin + #[] + proxies to headers#[] + #[]= + proxies to headers#[] + #headers + returns @headers instance variable + +HTTP::Options features + accepts plain symbols in array + accepts feature name with its options in array + defaults to be empty + raises error for not supported features + +HTTP::Options body defaults to nil + may be specified with with_body HTTP::Features::Logging logging the request @@ -2512,50 +2654,49 @@ logging the response should log the response -HTTP::Options proxy - accepts proxy address, port, username, and password - defaults to {} - may be specified with with_proxy +HTTP::Options form + may be specified with with_form_data + defaults to nil HTTP::Redirector #perform fails with EndlessRedirectError if endless loop detected - concatenates multiple Location headers returns first non-redirect response - fails with TooManyRedirectsError if max hops reached + concatenates multiple Location headers fails with StateError if there were no Location header - following 302 redirect + fails with TooManyRedirectsError if max hops reached + following 301 redirect with strict mode + it follows with original verb if it's safe + raises StateError if original request was POST raises StateError if original request was DELETE raises StateError if original request was PUT - raises StateError if original request was POST - it follows with original verb if it's safe with non-strict mode it follows with original verb if it's safe - it follows with GET if original request was POST - it follows with GET if original request was DELETE it follows with GET if original request was PUT - following 307 redirect - follows with original request's verb + it follows with GET if original request was DELETE + it follows with GET if original request was POST following 303 redirect follows with GET if original request was neither GET nor HEAD follows with GET if original request was GET follows with HEAD if original request was HEAD - following 300 redirect + following 308 redirect + follows with original request's verb + following 302 redirect with strict mode raises StateError if original request was PUT - it follows with original verb if it's safe raises StateError if original request was DELETE + it follows with original verb if it's safe raises StateError if original request was POST with non-strict mode - it follows with GET if original request was PUT + it follows with original verb if it's safe it follows with GET if original request was POST it follows with GET if original request was DELETE - it follows with original verb if it's safe - following 301 redirect + it follows with GET if original request was PUT + following 300 redirect with strict mode - raises StateError if original request was POST raises StateError if original request was DELETE + raises StateError if original request was POST it follows with original verb if it's safe raises StateError if original request was PUT with non-strict mode @@ -2563,306 +2704,201 @@ it follows with GET if original request was POST it follows with GET if original request was PUT it follows with original verb if it's safe - following 308 redirect + following 307 redirect follows with original request's verb - #max_hops - by default - is expected to eq 5 #strict by default is expected to equal true - -HTTP - unifies socket errors into HTTP::ConnectionError - .basic_auth - fails when :pass is not given - fails when :user is not given - sets Authorization header with proper BasicAuth value - fails when options is not a Hash - .nodelay - sets TCP_NODELAY on the underlying socket - posting forms to resources - is easy - .cookies - properly merges Cookie headers and cookies - properly works with cookie jars from response - passes correct `Cookie` header - properly merges cookies - with redirects - is easy for 302 - is easy for 301 - .via - anonymous proxy - ignores credentials - raises an argument error if no port given - proxies the request - responds with the endpoint's body - ssl - ignores credentials (PENDING: Temporarily skipped with xcontext) - responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) - proxy with authentication - responds with 407 if no credentials given - proxies the request - responds with the endpoint's body - responds with 407 when wrong credentials given - ssl - responds with 407 when wrong credentials given (PENDING: Temporarily skipped with xcontext) - responds with 407 if no credentials given (PENDING: Temporarily skipped with xcontext) - responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) - loading endpoint with charset - uses charset from headers - with encoding option - respects option - posting with an explicit body - is easy - getting resources - is easy - with headers - is easy - with a large request body - with `.timeout(6)` - writes the whole body - with `.timeout(:null)` - writes the whole body - with `.timeout({:read=>2, :write=>2, :connect=>2})` - writes the whole body - with query string parameters in the URI and opts hash - includes both - with query string parameters - is easy - with two leading slashes in path - is allowed - with URI instance - is easy - loading text with no charset - is binary encoded - head requests - is easy - .timeout - specifying a null timeout - sets timeout_class to Null - specifying a global timeout - sets given timeout option - sets timeout_class to Global - specifying per operation timeouts - sets timeout_class to PerOperation - sets given timeout options - .auth - sets Authorization header to the given value - accepts any #to_s object - .use - turns on given feature - with :normalize_uri - uses the custom URI Normalizer method - normalizes URI - uses the default URI normalizer - with :auto_deflate - sends gzipped body - sends deflated body - with :auto_inflate - returns deflated body - returns raw body when Content-Encoding type is missing - returns decoded body - passing a string encoding type - finds encoding - loading binary data - is encoded as bytes - .persistent - with timeout specified - sets keep_alive_timeout - with host only given - example at ./spec/lib/http_spec.rb:261 (PENDING: Temporarily skipped with xit) - example at ./spec/lib/http_spec.rb:260 (PENDING: Temporarily skipped with xit) - with host and block given - returns last evaluation of last expression (PENDING: Temporarily skipped with xit) - auto-closes connection (PENDING: Temporarily skipped with xit) + #max_hops + by default + is expected to eq 5 Pending: (Failures listed here are expected and do not affect your suite's status) - 1) HTTP::Client with a per operation timeout read of 0 times out + 1) HTTP.persistent with host only given # Temporarily skipped with xit - # ./spec/support/http_handling_shared.rb:47 + # ./spec/lib/http_spec.rb:260 - 2) HTTP::Client following redirects with non-ASCII URLs works like a charm in real world + 2) HTTP.persistent with host only given # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:100 + # ./spec/lib/http_spec.rb:261 - 3) HTTP::Client following redirects with non-ASCII URLs theoretically works like a charm + 3) HTTP.persistent with host and block given returns last evaluation of last expression # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:91 + # ./spec/lib/http_spec.rb:265 - 4) HTTP::Client working with SSL fails with OpenSSL::SSL::SSLError if host mismatch + 4) HTTP.persistent with host and block given auto-closes connection + # Temporarily skipped with xit + # ./spec/lib/http_spec.rb:269 + + 5) HTTP.via anonymous proxy ssl ignores credentials + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:104 + + 6) HTTP.via anonymous proxy ssl responds with the endpoint's body + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:99 + + 7) HTTP.via proxy with authentication ssl responds with 407 when wrong credentials given + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:140 + + 8) HTTP.via proxy with authentication ssl responds with 407 if no credentials given + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:145 + + 9) HTTP.via proxy with authentication ssl responds with the endpoint's body + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:135 + + 10) HTTP::Client#request with non-ASCII URLs theoretically works like a charm + # Temporarily skipped with xit + # ./spec/lib/http/client_spec.rb:225 + + 11) HTTP::Client#request with non-ASCII URLs works like a charm in real world + # Temporarily skipped with xit + # ./spec/lib/http/client_spec.rb:230 + + 12) HTTP::Client#request with explicitly given `Host` header keeps `Host` header as is + # Temporarily skipped with xit + # ./spec/lib/http/client_spec.rb:241 + + 13) HTTP::Client working with SSL fails with OpenSSL::SSL::SSLError if host mismatch # Temporarily skipped with xdescribe # ./spec/lib/http/client_spec.rb:309 - 5) HTTP::Client working with SSL just works + 14) HTTP::Client working with SSL just works # Temporarily skipped with xdescribe # ./spec/lib/http/client_spec.rb:304 - 6) HTTP::Client working with SSL connection reuse when enabled re-uses the socket + 15) HTTP::Client working with SSL with a per operation timeout works # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:117 + # ./spec/support/http_handling_shared.rb:29 - 7) HTTP::Client working with SSL connection reuse when enabled with a change in host errors + 16) HTTP::Client working with SSL with a per operation timeout connection of 1 does not time out # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:175 + # ./spec/support/http_handling_shared.rb:37 + + 17) HTTP::Client working with SSL with a per operation timeout read of 0 times out + # Temporarily skipped with xit + # ./spec/support/http_handling_shared.rb:47 - 8) HTTP::Client working with SSL connection reuse when enabled with a socket issue transparently reopens + 18) HTTP::Client working with SSL with a per operation timeout read of 2.5 does not time out # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:154 + # ./spec/support/http_handling_shared.rb:55 - 9) HTTP::Client working with SSL connection reuse when enabled when reading a cached body succeeds + 19) HTTP::Client working with SSL without timeouts works # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:142 + # ./spec/support/http_handling_shared.rb:7 - 10) HTTP::Client working with SSL connection reuse when enabled when trying to read a stale body errors + 20) HTTP::Client working with SSL with a global timeout errors if connecting takes too long # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:135 + # ./spec/support/http_handling_shared.rb:75 - 11) HTTP::Client working with SSL connection reuse when enabled on a mixed state re-opens the connection + 21) HTTP::Client working with SSL with a global timeout errors if reading takes too long # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:123 + # ./spec/support/http_handling_shared.rb:83 - 12) HTTP::Client working with SSL connection reuse when enabled without a host infers host from persistent config + 22) HTTP::Client working with SSL with a global timeout it resets state when reusing connections does not timeout # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:112 + # ./spec/support/http_handling_shared.rb:93 - 13) HTTP::Client working with SSL connection reuse when disabled opens new sockets + 23) HTTP::Client working with SSL connection reuse when disabled opens new sockets # Temporarily skipped with xdescribe # ./spec/support/http_handling_shared.rb:184 - 14) HTTP::Client working with SSL with SSL options instead of a context just works + 24) HTTP::Client working with SSL connection reuse when enabled re-uses the socket # Temporarily skipped with xdescribe - # ./spec/lib/http/client_spec.rb:319 + # ./spec/support/http_handling_shared.rb:117 - 15) HTTP::Client working with SSL with a global timeout errors if reading takes too long + 25) HTTP::Client working with SSL connection reuse when enabled with a change in host errors # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:83 + # ./spec/support/http_handling_shared.rb:175 - 16) HTTP::Client working with SSL with a global timeout errors if connecting takes too long + 26) HTTP::Client working with SSL connection reuse when enabled with a socket issue transparently reopens # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:75 + # ./spec/support/http_handling_shared.rb:154 - 17) HTTP::Client working with SSL with a global timeout it resets state when reusing connections does not timeout + 27) HTTP::Client working with SSL connection reuse when enabled on a mixed state re-opens the connection # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:93 + # ./spec/support/http_handling_shared.rb:123 - 18) HTTP::Client working with SSL without timeouts works + 28) HTTP::Client working with SSL connection reuse when enabled when reading a cached body succeeds # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:7 + # ./spec/support/http_handling_shared.rb:142 - 19) HTTP::Client working with SSL with a per operation timeout works + 29) HTTP::Client working with SSL connection reuse when enabled when trying to read a stale body errors # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:29 + # ./spec/support/http_handling_shared.rb:135 - 20) HTTP::Client working with SSL with a per operation timeout connection of 1 does not time out + 30) HTTP::Client working with SSL connection reuse when enabled without a host infers host from persistent config # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:37 - - 21) HTTP::Client working with SSL with a per operation timeout read of 0 times out - # Temporarily skipped with xit - # ./spec/support/http_handling_shared.rb:47 + # ./spec/support/http_handling_shared.rb:112 - 22) HTTP::Client working with SSL with a per operation timeout read of 2.5 does not time out + 31) HTTP::Client working with SSL with SSL options instead of a context just works # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:55 - - 23) HTTP::Client#request with explicitly given `Host` header keeps `Host` header as is - # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:241 - - 24) HTTP::Client#request with non-ASCII URLs theoretically works like a charm - # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:225 - - 25) HTTP::Client#request with non-ASCII URLs works like a charm in real world - # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:230 - - 26) HTTP.via anonymous proxy ssl ignores credentials - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:104 - - 27) HTTP.via anonymous proxy ssl responds with the endpoint's body - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:99 - - 28) HTTP.via proxy with authentication ssl responds with 407 when wrong credentials given - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:140 - - 29) HTTP.via proxy with authentication ssl responds with 407 if no credentials given - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:145 - - 30) HTTP.via proxy with authentication ssl responds with the endpoint's body - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:135 - - 31) HTTP.persistent with host only given - # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:261 + # ./spec/lib/http/client_spec.rb:319 - 32) HTTP.persistent with host only given + 32) HTTP::Client with a per operation timeout read of 0 times out # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:260 + # ./spec/support/http_handling_shared.rb:47 - 33) HTTP.persistent with host and block given returns last evaluation of last expression + 33) HTTP::Client following redirects with non-ASCII URLs works like a charm in real world # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:265 + # ./spec/lib/http/client_spec.rb:100 - 34) HTTP.persistent with host and block given auto-closes connection + 34) HTTP::Client following redirects with non-ASCII URLs theoretically works like a charm # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:269 + # ./spec/lib/http/client_spec.rb:91 -Top 10 slowest examples (10.31 seconds, 74.4% of total time): +Top 10 slowest examples (9.93 seconds, 74.7% of total time): HTTP::Client with a global timeout it resets state when reusing connections does not timeout 4.06 seconds ./spec/support/http_handling_shared.rb:93 HTTP::Client with a per operation timeout read of 2.5 does not time out 2.01 seconds ./spec/support/http_handling_shared.rb:55 HTTP unifies socket errors into HTTP::ConnectionError - 1.6 seconds ./spec/lib/http_spec.rb:455 + 1.31 seconds ./spec/lib/http_spec.rb:455 HTTP::Client with a global timeout errors if reading takes too long 1.01 seconds ./spec/support/http_handling_shared.rb:83 HTTP::Client with a global timeout errors if connecting takes too long 1.01 seconds ./spec/support/http_handling_shared.rb:75 HTTP getting resources with a large request body with `.timeout({:read=>2, :write=>2, :connect=>2})` writes the whole body - 0.20121 seconds ./spec/lib/http_spec.rb:64 + 0.16308 seconds ./spec/lib/http_spec.rb:64 HTTP::Connection#readpartial reads data in parts - 0.14382 seconds ./spec/lib/http/connection_spec.rb:54 - HTTP getting resources with a large request body with `.timeout(6)` writes the whole body - 0.11273 seconds ./spec/lib/http_spec.rb:64 + 0.15285 seconds ./spec/lib/http/connection_spec.rb:54 HTTP getting resources with a large request body with `.timeout(:null)` writes the whole body - 0.09137 seconds ./spec/lib/http_spec.rb:64 - HTTP::Client connection reuse when enabled re-uses the socket - 0.06113 seconds ./spec/support/http_handling_shared.rb:117 + 0.08186 seconds ./spec/lib/http_spec.rb:64 + HTTP getting resources with a large request body with `.timeout(6)` writes the whole body + 0.07715 seconds ./spec/lib/http_spec.rb:64 + HTTP.cookies properly merges cookies + 0.05838 seconds ./spec/lib/http_spec.rb:340 Top 10 slowest example groups: HTTP::Client - 0.13565 seconds average (8.68 seconds / 64 examples) ./spec/lib/http/client_spec.rb:8 + 0.13396 seconds average (8.57 seconds / 64 examples) ./spec/lib/http/client_spec.rb:8 HTTP::Connection - 0.07567 seconds average (0.15133 seconds / 2 examples) ./spec/lib/http/connection_spec.rb:3 + 0.0809 seconds average (0.16181 seconds / 2 examples) ./spec/lib/http/connection_spec.rb:3 HTTP - 0.04903 seconds average (3.09 seconds / 63 examples) ./spec/lib/http_spec.rb:9 + 0.04623 seconds average (2.91 seconds / 63 examples) ./spec/lib/http_spec.rb:9 + HTTP::Options headers + 0.0049 seconds average (0.01469 seconds / 3 examples) ./spec/lib/http/options/headers_spec.rb:3 + HTTP::Options new + 0.00468 seconds average (0.0234 seconds / 5 examples) ./spec/lib/http/options/new_spec.rb:3 HTTP::Response::Parser - 0.00639 seconds average (0.02554 seconds / 4 examples) ./spec/lib/http/response/parser_spec.rb:3 - HTTP::Response::Body - 0.00634 seconds average (0.05074 seconds / 8 examples) ./spec/lib/http/response/body_spec.rb:3 - HTTP::Options merge - 0.00544 seconds average (0.01633 seconds / 3 examples) ./spec/lib/http/options/merge_spec.rb:3 - HTTP::Features::AutoInflate - 0.00537 seconds average (0.03761 seconds / 7 examples) ./spec/lib/http/features/auto_inflate_spec.rb:3 + 0.00403 seconds average (0.01612 seconds / 4 examples) ./spec/lib/http/response/parser_spec.rb:3 HTTP::Request - 0.00514 seconds average (0.23113 seconds / 45 examples) ./spec/lib/http/request_spec.rb:4 - HTTP::Response - 0.0045 seconds average (0.11246 seconds / 25 examples) ./spec/lib/http/response_spec.rb:3 + 0.00372 seconds average (0.16751 seconds / 45 examples) ./spec/lib/http/request_spec.rb:4 HTTP::Redirector - 0.00402 seconds average (0.14485 seconds / 36 examples) ./spec/lib/http/redirector_spec.rb:3 + 0.00366 seconds average (0.13189 seconds / 36 examples) ./spec/lib/http/redirector_spec.rb:3 + HTTP::Headers + 0.00306 seconds average (0.22607 seconds / 74 examples) ./spec/lib/http/headers_spec.rb:3 + HTTP::Features::AutoInflate + 0.0029 seconds average (0.02027 seconds / 7 examples) ./spec/lib/http/features/auto_inflate_spec.rb:3 -Finished in 13.85 seconds (files took 3.48 seconds to load) +Finished in 13.28 seconds (files took 3.31 seconds to load) 811 examples, 0 failures, 34 pending -Randomized with seed 55021 +Randomized with seed 58301 Coverage report generated for RSpec to /build/reproducible-path/ruby-http-4.4.1/coverage. 1267 / 1359 LOC (93.23%) covered. [Coveralls] Outside the CI environment, not sending data. @@ -2893,744 +2929,1110 @@ All examples were filtered out; ignoring {:focus=>true} -Randomized with seed 36772 +Randomized with seed 33146 + +HTTP::Features::Instrumentation + logging the response + should log the response + logging the request + should log the request + +HTTP::Request::Body + #each + when body is nil + yields nothing + when body is a string + yields the string + when body is an Enumerable + yields elements + when body is a non-Enumerable IO + yields chunks of content + when body is an Enumerable IO + yields chunks of content + allows to enumerate multiple times + when body is a pipe + yields chunks of content + #size + when body is a string + returns string bytesize + when body is an IO with size + returns IO size + when body is an Enumerable + raises a RequestError + when body is nil + returns zero + when body is an IO without size + raises a RequestError + #== + when sources are not equivalent + returns false + when sources are equivalent + returns true + when objects are not of the same class + returns false + #initialize + when body is an Enumerable + does not raise an error + when body is an IO + does not raise an error + when body is a string + does not raise an error + when body is of unrecognized type + raises an error + when body is nil + does not raise an error + #source + returns the original object + +HTTP::Request::Writer + #stream + when Transfer-Encoding is chunked + writes encoded content and omits Content-Length + when body is nonempty + writes it to the socket and sets Content-Length + when multiple headers are set + separates headers with carriage return and line feed + when Content-Length header is set + keeps the given value + when server won't accept any more data + aborts silently + when body is empty + doesn't write anything to the socket and sets Content-Length + when writing to socket raises an exception + raises a ConnectionError + +HTTP::Client + #request + with non-ASCII URLs + theoretically works like a charm (PENDING: Temporarily skipped with xit) + works like a charm in real world (PENDING: Temporarily skipped with xit) + with explicitly given `Host` header + keeps `Host` header as is (PENDING: Temporarily skipped with xit) + when :auto_deflate was specified + sets Content-Encoding header + deletes Content-Length header + and there is no body + doesn't set Content-Encoding header + with a per operation timeout + works + read + of 0 + times out (PENDING: Temporarily skipped with xit) + of 2.5 + does not time out + connection + of 1 + does not time out + connection reuse + when enabled + re-uses the socket + without a host + infers host from persistent config + when reading a cached body + succeeds + when trying to read a stale body + errors + with a socket issue + transparently reopens + on a mixed state + re-opens the connection + with a change in host + errors + when disabled + opens new sockets + #perform + calls finish_response once body was fully flushed + with HEAD request + finishes response after headers were received + does not iterates through body + when uses chunked transfer encoding + properly reads body + with broken body (too early closed connection) + raises HTTP::ConnectionError + when server fully flushes response in one chunk + properly reads body + working with SSL + fails with OpenSSL::SSL::SSLError if host mismatch (PENDING: Temporarily skipped with xdescribe) + just works (PENDING: Temporarily skipped with xdescribe) + with a global timeout + errors if reading takes too long (PENDING: Temporarily skipped with xdescribe) + errors if connecting takes too long (PENDING: Temporarily skipped with xdescribe) + it resets state when reusing connections + does not timeout (PENDING: Temporarily skipped with xdescribe) + without timeouts + works (PENDING: Temporarily skipped with xdescribe) + with a per operation timeout + works (PENDING: Temporarily skipped with xdescribe) + connection + of 1 + does not time out (PENDING: Temporarily skipped with xdescribe) + read + of 0 + times out (PENDING: Temporarily skipped with xit) + of 2.5 + does not time out (PENDING: Temporarily skipped with xdescribe) + with SSL options instead of a context + just works (PENDING: Temporarily skipped with xdescribe) + connection reuse + when enabled + re-uses the socket (PENDING: Temporarily skipped with xdescribe) + with a socket issue + transparently reopens (PENDING: Temporarily skipped with xdescribe) + when reading a cached body + succeeds (PENDING: Temporarily skipped with xdescribe) + when trying to read a stale body + errors (PENDING: Temporarily skipped with xdescribe) + on a mixed state + re-opens the connection (PENDING: Temporarily skipped with xdescribe) + without a host + infers host from persistent config (PENDING: Temporarily skipped with xdescribe) + with a change in host + errors (PENDING: Temporarily skipped with xdescribe) + when disabled + opens new sockets (PENDING: Temporarily skipped with xdescribe) + passing multipart form data + creates multipart form data object + creates url encoded form data object + when passing an HTTP::FormData object directly + creates url encoded form data object + following redirects + returns response of new location + fails if max amount of hops reached + prepends previous request uri scheme and host if needed + fails upon endless redirects + with non-ASCII URLs + theoretically works like a charm (PENDING: Temporarily skipped with xit) + works like a charm in real world (PENDING: Temporarily skipped with xit) + with a global timeout + errors if reading takes too long + errors if connecting takes too long + it resets state when reusing connections + does not timeout + parsing params + merges duplicate values + does not modifies query part if no params were given + combines GET params from the URI with the passed in params + does not corrupts index-less arrays + does not convert newlines into \r\n before encoding string values + accepts params within the provided URL + properly encodes colons + passing json + encodes given object + without timeouts + works + +HTTP::Connection + #read_headers! + reads data in parts + #readpartial + reads data in parts + +HTTP::ContentType + .parse + with text/plain;charset=utf-8;foo=bar + charset + is expected to eq "utf-8" + mime_type + is expected to eq "text/plain" + with text/plain; charSET=utf-8 + charset + is expected to eq "utf-8" + mime_type + is expected to eq "text/plain" + with text/plain; foo=bar; charset=utf-8 + mime_type + is expected to eq "text/plain" + charset + is expected to eq "utf-8" + with tEXT/plaIN + mime_type + is expected to eq "text/plain" + charset + is expected to be nil + with text/plain + charset + is expected to be nil + mime_type + is expected to eq "text/plain" + with text/plain; charset="utf-8" + charset + is expected to eq "utf-8" + mime_type + is expected to eq "text/plain" + with text/plain; charset=utf-8 + mime_type + is expected to eq "text/plain" + charset + is expected to eq "utf-8" + +HTTP::Options proxy + accepts proxy address, port, username, and password + may be specified with with_proxy + defaults to {} + +HTTP::Headers::Mixin + #[] + proxies to headers#[] + #headers + returns @headers instance variable + #[]= + proxies to headers#[] HTTP::URI sets default ports for HTTPS URIs - sets default ports for HTTP URIs knows URI schemes + sets default ports for HTTP URIs #dup doesn't share internal value between duplicates +HTTP::Features::AutoInflate + #wrap_response + for x-gzip Content-Encoding header + returns a HTTP::Response wrapping the inflated response body + when there is no Content-Encoding header + returns original request + for identity Content-Encoding header + returns original request + for gzip Content-Encoding header + returns a HTTP::Response wrapping the inflated response body + when response has uri + preserves uri in wrapped response + for unknown Content-Encoding header + returns original request + for deflate Content-Encoding header + returns a HTTP::Response wrapping the inflated response body + +HTTP + unifies socket errors into HTTP::ConnectionError + loading text with no charset + is binary encoded + .via + proxy with authentication + responds with 407 if no credentials given + proxies the request + responds with the endpoint's body + responds with 407 when wrong credentials given + ssl + responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) + responds with 407 when wrong credentials given (PENDING: Temporarily skipped with xcontext) + responds with 407 if no credentials given (PENDING: Temporarily skipped with xcontext) + anonymous proxy + ignores credentials + proxies the request + raises an argument error if no port given + responds with the endpoint's body + ssl + ignores credentials (PENDING: Temporarily skipped with xcontext) + responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) + .use + turns on given feature + with :auto_deflate + sends deflated body + sends gzipped body + with :auto_inflate + returns deflated body + returns decoded body + returns raw body when Content-Encoding type is missing + with :normalize_uri + uses the default URI normalizer + normalizes URI + uses the custom URI Normalizer method + loading endpoint with charset + uses charset from headers + with encoding option + respects option + .auth + sets Authorization header to the given value + accepts any #to_s object + with redirects + is easy for 301 + is easy for 302 + head requests + is easy + .cookies + properly merges Cookie headers and cookies + passes correct `Cookie` header + properly merges cookies + properly works with cookie jars from response + .nodelay + sets TCP_NODELAY on the underlying socket + posting with an explicit body + is easy + .persistent + with host and block given + returns last evaluation of last expression (PENDING: Temporarily skipped with xit) + auto-closes connection (PENDING: Temporarily skipped with xit) + with host only given + example at ./spec/lib/http_spec.rb:261 (PENDING: Temporarily skipped with xit) + example at ./spec/lib/http_spec.rb:260 (PENDING: Temporarily skipped with xit) + with timeout specified + sets keep_alive_timeout + posting forms to resources + is easy + .basic_auth + sets Authorization header with proper BasicAuth value + fails when :user is not given + fails when :pass is not given + fails when options is not a Hash + .timeout + specifying a global timeout + sets timeout_class to Global + sets given timeout option + specifying a null timeout + sets timeout_class to Null + specifying per operation timeouts + sets timeout_class to PerOperation + sets given timeout options + passing a string encoding type + finds encoding + getting resources + is easy + with headers + is easy + with URI instance + is easy + with two leading slashes in path + is allowed + with query string parameters in the URI and opts hash + includes both + with a large request body + with `.timeout(6)` + writes the whole body + with `.timeout(:null)` + writes the whole body + with `.timeout({:read=>2, :write=>2, :connect=>2})` + writes the whole body + with query string parameters + is easy + loading binary data + is encoded as bytes + HTTP::Response includes HTTP::Headers::Mixin + #content_length + with invalid Content-Length + is expected to be nil + without Content-Length header + is expected to be nil + with Content-Length: 5 + is expected to eq 5 #flush - returns response self-reference flushes body - to_a - returns a Rack-like array + returns response self-reference #parse with known content type returns parsed body - with explicitly given mime type - ignores mime_type of response - supports MIME type aliases with unknown content type raises HTTP::Error - #content_length - without Content-Length header - is expected to be nil - with invalid Content-Length - is expected to be nil - with Content-Length: 5 - is expected to eq 5 - #chunked? - is expected not to be chunked - when encoding is set to chunked - is expected to be chunked + with explicitly given mime type + supports MIME type aliases + ignores mime_type of response #connection returns the connection object used to instantiate the response + #inspect + is expected to eq "#\"text/plain\"}>" #cookies - does not contains cookies limited to non-requeted uri - is expected to be a kind of HTTP::CookieJar contains cookies limited to domain of request uri contains cookies without domain restriction - mime_type + is expected to be a kind of HTTP::CookieJar + does not contains cookies limited to non-requeted uri + to_a + returns a Rack-like array + charset with Content-Type: text/html; charset=utf-8 - is expected to eq "text/html" + is expected to eq "utf-8" + with Content-Type: text/html + is expected to be nil without Content-Type header is expected to be nil - with Content-Type: text/html + mime_type + with Content-Type: text/html; charset=utf-8 is expected to eq "text/html" - #inspect - is expected to eq "#\"text/plain\"}>" - charset without Content-Type header is expected to be nil - with Content-Type: text/html; charset=utf-8 - is expected to eq "utf-8" with Content-Type: text/html - is expected to be nil + is expected to eq "text/html" + #chunked? + is expected not to be chunked + when encoding is set to chunked + is expected to be chunked -HTTP::Request::Body - #initialize - when body is nil - does not raise an error - when body is of unrecognized type - raises an error - when body is an Enumerable - does not raise an error - when body is a string - does not raise an error - when body is an IO - does not raise an error - #== - when objects are not of the same class - returns false - when sources are equivalent - returns true - when sources are not equivalent - returns false - #source - returns the original object - #size - when body is nil - returns zero - when body is an IO with size - returns IO size - when body is an Enumerable - raises a RequestError - when body is an IO without size - raises a RequestError - when body is a string - returns string bytesize - #each - when body is an Enumerable - yields elements - when body is a pipe - yields chunks of content - when body is a non-Enumerable IO - yields chunks of content - when body is an Enumerable IO - yields chunks of content - allows to enumerate multiple times - when body is nil - yields nothing - when body is a string - yields the string +HTTP::Features::AutoDeflate + raises error for wrong type + accepts deflate method + accepts string as method + accepts gzip method + uses gzip by default + #deflated_body + when method is deflate + caches compressed content when size is called + returns object which yields deflated content of the given body + when method is gzip + returns object which yields gzipped content of the given body + caches compressed content when size is called -HTTP::Response::Parser - whole response in one part - parses body - parses headers - response in many parts - parses body - parses headers +HTTP::Options body + may be specified with with_body + defaults to nil HTTP::Response::Status - #unavailable_for_legal_reasons? - when code is higher than 451 + #variant_also_negotiates? + when code is 506 + is expected to equal true + when code is higher than 506 is expected to equal false - when code is 451 + when code is lower than 506 + is expected to equal false + #non_authoritative_information? + when code is lower than 203 + is expected to equal false + when code is higher than 203 + is expected to equal false + when code is 203 is expected to equal true - when code is lower than 451 + #locked? + when code is lower than 423 is expected to equal false - #not_extended? - when code is lower than 510 + when code is higher than 423 is expected to equal false - when code is 510 + when code is 423 is expected to equal true - when code is higher than 510 + #reset_content? + when code is lower than 205 is expected to equal false - #no_content? - when code is 204 + when code is 205 is expected to equal true - when code is lower than 204 + when code is higher than 205 is expected to equal false - when code is higher than 204 + #request_header_fields_too_large? + when code is 431 + is expected to equal true + when code is higher than 431 is expected to equal false - #partial_content? - when code is lower than 206 + when code is lower than 431 is expected to equal false - when code is 206 + #length_required? + when code is 411 is expected to equal true - when code is higher than 206 + when code is higher than 411 is expected to equal false + when code is lower than 411 + is expected to equal false + #not_found? + when code is lower than 404 + is expected to equal false + when code is higher than 404 + is expected to equal false + when code is 404 + is expected to equal true #forbidden? + when code is higher than 403 + is expected to equal false when code is lower than 403 is expected to equal false when code is 403 is expected to equal true - when code is higher than 403 + .coerce + is aliased as `.[]` + fails if coercion failed + with String + coerces reasons + fails when reason is unknown + with Symbol + fails when symbolized reason is unknown + coerces symbolized reasons + with Numeric + coerces as Fixnum code + #created? + when code is higher than 201 is expected to equal false - #see_other? - when code is 303 + when code is 201 is expected to equal true - when code is lower than 303 + when code is lower than 201 is expected to equal false - when code is higher than 303 + #accepted? + when code is lower than 202 is expected to equal false - #code - is expected to be a kind of Integer - is expected to eq 200 - #unauthorized? - when code is 401 + when code is higher than 202 + is expected to equal false + when code is 202 is expected to equal true - when code is lower than 401 + #moved_permanently? + when code is 301 + is expected to equal true + when code is lower than 301 is expected to equal false - when code is higher than 401 + when code is higher than 301 is expected to equal false - #variant_also_negotiates? - when code is 506 - is expected to equal true - when code is higher than 506 + #multi_status? + when code is lower than 207 is expected to equal false - when code is lower than 506 + when code is 207 + is expected to equal true + when code is higher than 207 is expected to equal false - #permanent_redirect? - when code is 308 + #method_not_allowed? + when code is 405 is expected to equal true - when code is lower than 308 + when code is higher than 405 is expected to equal false - when code is higher than 308 + when code is lower than 405 is expected to equal false - #already_reported? - when code is 208 + #proxy_authentication_required? + when code is 407 is expected to equal true - when code is higher than 208 - is expected to equal false - when code is lower than 208 + when code is higher than 407 is expected to equal false - #precondition_failed? - when code is lower than 412 + when code is lower than 407 is expected to equal false - when code is 412 + #no_content? + when code is 204 is expected to equal true - when code is higher than 412 + when code is higher than 204 is expected to equal false - #not_found? - when code is lower than 404 + when code is lower than 204 is expected to equal false - when code is higher than 404 + #see_other? + when code is higher than 303 is expected to equal false - when code is 404 + when code is lower than 303 + is expected to equal false + when code is 303 + is expected to equal true + #im_used? + when code is 226 is expected to equal true + when code is lower than 226 + is expected to equal false + when code is higher than 226 + is expected to equal false #misdirected_request? when code is lower than 421 is expected to equal false - when code is higher than 421 - is expected to equal false when code is 421 is expected to equal true - #unprocessable_entity? - when code is lower than 422 + when code is higher than 421 is expected to equal false - when code is 422 - is expected to equal true - when code is higher than 422 + #permanent_redirect? + when code is lower than 308 is expected to equal false - #failed_dependency? - when code is 424 + when code is 308 is expected to equal true - when code is lower than 424 + when code is higher than 308 is expected to equal false - when code is higher than 424 + #service_unavailable? + when code is lower than 503 is expected to equal false - .new - accepts any object that responds to #to_i - fails if given value does not respond to #to_i - #payload_too_large? - when code is lower than 413 + when code is higher than 503 is expected to equal false - when code is higher than 413 + when code is 503 + is expected to equal true + #switching_protocols? + when code is lower than 101 is expected to equal false - when code is 413 + when code is 101 is expected to equal true - #locked? - when code is higher than 423 + when code is higher than 101 is expected to equal false - when code is 423 + #too_many_requests? + when code is 429 is expected to equal true - when code is lower than 423 + when code is higher than 429 is expected to equal false - #bad_gateway? - when code is higher than 502 + when code is lower than 429 is expected to equal false - when code is 502 + ::SYMBOLS + [400] + is expected to equal :bad_request + [200] + is expected to equal :ok + #gateway_timeout? + when code is higher than 504 + is expected to equal false + when code is 504 is expected to equal true - when code is lower than 502 + when code is lower than 504 is expected to equal false - #internal_server_error? - when code is 500 + #use_proxy? + when code is lower than 305 + is expected to equal false + when code is 305 is expected to equal true - when code is higher than 500 + when code is higher than 305 is expected to equal false - when code is lower than 500 + #partial_content? + when code is higher than 206 is expected to equal false - #loop_detected? - when code is higher than 508 + when code is lower than 206 is expected to equal false - when code is 508 + when code is 206 is expected to equal true - when code is lower than 508 + #unprocessable_entity? + when code is 422 + is expected to equal true + when code is higher than 422 is expected to equal false - #expectation_failed? - when code is higher than 417 + when code is lower than 422 is expected to equal false - when code is lower than 417 + #not_implemented? + when code is higher than 501 is expected to equal false - when code is 417 + when code is lower than 501 + is expected to equal false + when code is 501 is expected to equal true - #service_unavailable? - when code is lower than 503 + .new + accepts any object that responds to #to_i + fails if given value does not respond to #to_i + #already_reported? + when code is lower than 208 is expected to equal false - when code is higher than 503 + when code is higher than 208 is expected to equal false - when code is 503 + when code is 208 is expected to equal true - #to_sym - with well-known code: 303 - is expected to equal :see_other - with well-known code: 415 - is expected to equal :unsupported_media_type - with well-known code: 431 - is expected to equal :request_header_fields_too_large - with well-known code: 505 - is expected to equal :http_version_not_supported - with well-known code: 100 - is expected to equal :continue - with well-known code: 414 - is expected to equal :uri_too_long - with well-known code: 200 - is expected to equal :ok - with well-known code: 101 - is expected to equal :switching_protocols - with well-known code: 426 - is expected to equal :upgrade_required - with well-known code: 417 - is expected to equal :expectation_failed - with well-known code: 405 - is expected to equal :method_not_allowed - with well-known code: 402 - is expected to equal :payment_required - with well-known code: 301 - is expected to equal :moved_permanently - with well-known code: 508 - is expected to equal :loop_detected - with well-known code: 506 - is expected to equal :variant_also_negotiates - with well-known code: 304 - is expected to equal :not_modified - with well-known code: 300 - is expected to equal :multiple_choices - with well-known code: 203 - is expected to equal :non_authoritative_information - with well-known code: 207 - is expected to equal :multi_status - with well-known code: 451 - is expected to equal :unavailable_for_legal_reasons - with well-known code: 409 - is expected to equal :conflict - with well-known code: 204 - is expected to equal :no_content - with well-known code: 429 - is expected to equal :too_many_requests - with well-known code: 412 - is expected to equal :precondition_failed - with well-known code: 507 - is expected to equal :insufficient_storage - with well-known code: 206 - is expected to equal :partial_content - with well-known code: 500 - is expected to equal :internal_server_error - with well-known code: 407 - is expected to equal :proxy_authentication_required - with well-known code: 413 - is expected to equal :payload_too_large - with well-known code: 308 - is expected to equal :permanent_redirect - with well-known code: 424 - is expected to equal :failed_dependency - with unknown code - is expected to be nil - with well-known code: 401 - is expected to equal :unauthorized - with well-known code: 416 - is expected to equal :range_not_satisfiable - with well-known code: 410 - is expected to equal :gone - with well-known code: 408 - is expected to equal :request_timeout - with well-known code: 422 - is expected to equal :unprocessable_entity - with well-known code: 428 - is expected to equal :precondition_required - with well-known code: 510 - is expected to equal :not_extended - with well-known code: 102 - is expected to equal :processing - with well-known code: 501 - is expected to equal :not_implemented - with well-known code: 503 - is expected to equal :service_unavailable - with well-known code: 305 - is expected to equal :use_proxy - with well-known code: 201 - is expected to equal :created + #reason with well-known code: 226 - is expected to equal :im_used - with well-known code: 502 - is expected to equal :bad_gateway + is expected to eq "IM Used" + is expected to be frozen with well-known code: 423 - is expected to equal :locked - with well-known code: 421 - is expected to equal :misdirected_request - with well-known code: 208 - is expected to equal :already_reported - with well-known code: 511 - is expected to equal :network_authentication_required - with well-known code: 404 - is expected to equal :not_found - with well-known code: 403 - is expected to equal :forbidden - with well-known code: 202 - is expected to equal :accepted - with well-known code: 302 - is expected to equal :found - with well-known code: 400 - is expected to equal :bad_request - with well-known code: 406 - is expected to equal :not_acceptable - with well-known code: 411 - is expected to equal :length_required - with well-known code: 504 - is expected to equal :gateway_timeout - with well-known code: 205 - is expected to equal :reset_content - with well-known code: 307 - is expected to equal :temporary_redirect - #reason - with well-known code: 504 + is expected to eq "Locked" is expected to be frozen - is expected to eq "Gateway Timeout" - with well-known code: 307 - is expected to eq "Temporary Redirect" + with well-known code: 203 is expected to be frozen - with well-known code: 409 + is expected to eq "Non-Authoritative Information" + with well-known code: 508 + is expected to eq "Loop Detected" is expected to be frozen - is expected to eq "Conflict" - with unknown code - is expected to be nil - with well-known code: 415 + with well-known code: 510 is expected to be frozen - is expected to eq "Unsupported Media Type" - with well-known code: 404 - is expected to eq "Not Found" + is expected to eq "Not Extended" + with well-known code: 451 is expected to be frozen - with well-known code: 417 - is expected to eq "Expectation Failed" + is expected to eq "Unavailable For Legal Reasons" + with well-known code: 505 is expected to be frozen - with well-known code: 508 + is expected to eq "HTTP Version Not Supported" + with well-known code: 404 is expected to be frozen - is expected to eq "Loop Detected" - with well-known code: 414 - is expected to eq "URI Too Long" + is expected to eq "Not Found" + with well-known code: 407 + is expected to eq "Proxy Authentication Required" is expected to be frozen - with well-known code: 200 + with well-known code: 422 + is expected to eq "Unprocessable Entity" is expected to be frozen - is expected to eq "OK" - with well-known code: 303 - is expected to eq "See Other" + with well-known code: 500 is expected to be frozen + is expected to eq "Internal Server Error" + with well-known code: 413 + is expected to be frozen + is expected to eq "Payload Too Large" with well-known code: 201 is expected to be frozen is expected to eq "Created" - with well-known code: 406 + with well-known code: 429 is expected to be frozen - is expected to eq "Not Acceptable" - with well-known code: 402 - is expected to eq "Payment Required" + is expected to eq "Too Many Requests" + with well-known code: 403 + is expected to eq "Forbidden" is expected to be frozen - with well-known code: 410 + with well-known code: 426 is expected to be frozen - is expected to eq "Gone" - with well-known code: 502 - is expected to eq "Bad Gateway" + is expected to eq "Upgrade Required" + with well-known code: 208 is expected to be frozen - with well-known code: 101 - is expected to eq "Switching Protocols" + is expected to eq "Already Reported" + with well-known code: 504 + is expected to eq "Gateway Timeout" is expected to be frozen - with well-known code: 206 - is expected to eq "Partial Content" + with well-known code: 207 + is expected to eq "Multi-Status" is expected to be frozen - with well-known code: 202 - is expected to eq "Accepted" + with well-known code: 417 is expected to be frozen + is expected to eq "Expectation Failed" + with well-known code: 308 + is expected to eq "Permanent Redirect" + is expected to be frozen + with well-known code: 431 + is expected to be frozen + is expected to eq "Request Header Fields Too Large" with well-known code: 501 is expected to eq "Not Implemented" is expected to be frozen - with well-known code: 423 + with well-known code: 303 is expected to be frozen - is expected to eq "Locked" - with well-known code: 505 + is expected to eq "See Other" + with well-known code: 408 is expected to be frozen - is expected to eq "HTTP Version Not Supported" - with well-known code: 208 - is expected to eq "Already Reported" + is expected to eq "Request Timeout" + with well-known code: 307 + is expected to eq "Temporary Redirect" is expected to be frozen - with well-known code: 428 - is expected to eq "Precondition Required" + with well-known code: 101 + is expected to eq "Switching Protocols" is expected to be frozen - with well-known code: 411 + with well-known code: 503 + is expected to eq "Service Unavailable" is expected to be frozen - is expected to eq "Length Required" - with well-known code: 204 + with well-known code: 511 + is expected to eq "Network Authentication Required" is expected to be frozen - is expected to eq "No Content" - with well-known code: 429 + with unknown code + is expected to be nil + with well-known code: 416 is expected to be frozen - is expected to eq "Too Many Requests" - with well-known code: 300 + is expected to eq "Range Not Satisfiable" + with well-known code: 100 is expected to be frozen - is expected to eq "Multiple Choices" - with well-known code: 226 + is expected to eq "Continue" + with well-known code: 428 + is expected to eq "Precondition Required" + is expected to be frozen + with well-known code: 202 + is expected to be frozen + is expected to eq "Accepted" + with well-known code: 406 + is expected to be frozen + is expected to eq "Not Acceptable" + with well-known code: 414 + is expected to eq "URI Too Long" is expected to be frozen - is expected to eq "IM Used" with well-known code: 304 is expected to eq "Not Modified" is expected to be frozen - with well-known code: 308 + with well-known code: 412 + is expected to eq "Precondition Failed" is expected to be frozen - is expected to eq "Permanent Redirect" - with well-known code: 405 - is expected to eq "Method Not Allowed" + with well-known code: 204 is expected to be frozen - with well-known code: 510 - is expected to eq "Not Extended" + is expected to eq "No Content" + with well-known code: 502 + is expected to eq "Bad Gateway" is expected to be frozen - with well-known code: 500 - is expected to eq "Internal Server Error" + with well-known code: 424 is expected to be frozen - with well-known code: 403 - is expected to eq "Forbidden" + is expected to eq "Failed Dependency" + with well-known code: 411 + is expected to eq "Length Required" is expected to be frozen with well-known code: 400 is expected to be frozen is expected to eq "Bad Request" - with well-known code: 301 - is expected to be frozen - is expected to eq "Moved Permanently" - with well-known code: 408 - is expected to be frozen - is expected to eq "Request Timeout" - with well-known code: 431 - is expected to eq "Request Header Fields Too Large" + with well-known code: 405 is expected to be frozen - with well-known code: 407 - is expected to eq "Proxy Authentication Required" + is expected to eq "Method Not Allowed" + with well-known code: 206 + is expected to eq "Partial Content" is expected to be frozen - with well-known code: 305 - is expected to eq "Use Proxy" + with well-known code: 300 + is expected to eq "Multiple Choices" is expected to be frozen - with well-known code: 102 + with well-known code: 415 is expected to be frozen - is expected to eq "Processing" - with well-known code: 413 + is expected to eq "Unsupported Media Type" + with well-known code: 410 is expected to be frozen - is expected to eq "Payload Too Large" - with well-known code: 401 - is expected to eq "Unauthorized" + is expected to eq "Gone" + with well-known code: 302 + is expected to eq "Found" is expected to be frozen - with well-known code: 422 + with well-known code: 421 is expected to be frozen - is expected to eq "Unprocessable Entity" - with well-known code: 424 + is expected to eq "Misdirected Request" + with well-known code: 409 + is expected to eq "Conflict" is expected to be frozen - is expected to eq "Failed Dependency" - with well-known code: 503 + with well-known code: 402 is expected to be frozen - is expected to eq "Service Unavailable" - with well-known code: 511 - is expected to eq "Network Authentication Required" + is expected to eq "Payment Required" + with well-known code: 102 + is expected to eq "Processing" is expected to be frozen - with well-known code: 207 + with well-known code: 401 is expected to be frozen - is expected to eq "Multi-Status" - with well-known code: 205 + is expected to eq "Unauthorized" + with well-known code: 200 + is expected to eq "OK" is expected to be frozen - is expected to eq "Reset Content" with well-known code: 507 is expected to be frozen is expected to eq "Insufficient Storage" - with well-known code: 426 - is expected to eq "Upgrade Required" - is expected to be frozen - with well-known code: 416 - is expected to be frozen - is expected to eq "Range Not Satisfiable" - with well-known code: 203 + with well-known code: 305 is expected to be frozen - is expected to eq "Non-Authoritative Information" + is expected to eq "Use Proxy" with well-known code: 506 is expected to be frozen is expected to eq "Variant Also Negotiates" - with well-known code: 302 - is expected to eq "Found" - is expected to be frozen - with well-known code: 100 - is expected to eq "Continue" - is expected to be frozen - with well-known code: 451 - is expected to be frozen - is expected to eq "Unavailable For Legal Reasons" - with well-known code: 421 - is expected to eq "Misdirected Request" + with well-known code: 205 is expected to be frozen - with well-known code: 412 - is expected to eq "Precondition Failed" + is expected to eq "Reset Content" + with well-known code: 301 + is expected to eq "Moved Permanently" is expected to be frozen - #request_timeout? - when code is higher than 408 - is expected to equal false - when code is 408 - is expected to equal true - when code is lower than 408 + #loop_detected? + when code is lower than 508 is expected to equal false - #temporary_redirect? - when code is 307 + when code is 508 is expected to equal true - when code is lower than 307 + when code is higher than 508 is expected to equal false - when code is higher than 307 + #bad_gateway? + when code is higher than 502 is expected to equal false - #created? - when code is higher than 201 + when code is 502 + is expected to equal true + when code is lower than 502 is expected to equal false - when code is lower than 201 + #upgrade_required? + when code is higher than 426 is expected to equal false - when code is 201 + when code is 426 is expected to equal true - #conflict? - when code is lower than 409 + when code is lower than 426 is expected to equal false - when code is higher than 409 + with 3xx codes + is not #success? + is #redirect? + is not #server_error? + is not #client_error? + is not #informational? + #unauthorized? + when code is higher than 401 is expected to equal false - when code is 409 - is expected to equal true - #network_authentication_required? - when code is 511 + when code is 401 is expected to equal true - when code is higher than 511 + when code is lower than 401 is expected to equal false - when code is lower than 511 + #payment_required? + when code is 402 + is expected to equal true + when code is lower than 402 is expected to equal false - #not_acceptable? - when code is lower than 406 + when code is higher than 402 is expected to equal false - when code is higher than 406 + #failed_dependency? + when code is lower than 424 is expected to equal false - when code is 406 + when code is 424 is expected to equal true - #processing? - when code is higher than 102 - is expected to equal false - when code is lower than 102 + when code is higher than 424 is expected to equal false - when code is 102 - is expected to equal true - with 5xx codes - is not #success? - is not #client_error? - is not #redirect? - is #server_error? - is not #informational? - #range_not_satisfiable? - when code is lower than 416 + #to_sym + with well-known code: 510 + is expected to equal :not_extended + with well-known code: 401 + is expected to equal :unauthorized + with well-known code: 413 + is expected to equal :payload_too_large + with well-known code: 405 + is expected to equal :method_not_allowed + with well-known code: 300 + is expected to equal :multiple_choices + with well-known code: 417 + is expected to equal :expectation_failed + with well-known code: 308 + is expected to equal :permanent_redirect + with well-known code: 203 + is expected to equal :non_authoritative_information + with well-known code: 505 + is expected to equal :http_version_not_supported + with well-known code: 202 + is expected to equal :accepted + with well-known code: 302 + is expected to equal :found + with well-known code: 508 + is expected to equal :loop_detected + with well-known code: 207 + is expected to equal :multi_status + with well-known code: 410 + is expected to equal :gone + with well-known code: 100 + is expected to equal :continue + with well-known code: 412 + is expected to equal :precondition_failed + with well-known code: 500 + is expected to equal :internal_server_error + with well-known code: 204 + is expected to equal :no_content + with well-known code: 414 + is expected to equal :uri_too_long + with well-known code: 403 + is expected to equal :forbidden + with well-known code: 402 + is expected to equal :payment_required + with well-known code: 415 + is expected to equal :unsupported_media_type + with well-known code: 507 + is expected to equal :insufficient_storage + with well-known code: 504 + is expected to equal :gateway_timeout + with well-known code: 424 + is expected to equal :failed_dependency + with well-known code: 101 + is expected to equal :switching_protocols + with well-known code: 416 + is expected to equal :range_not_satisfiable + with well-known code: 307 + is expected to equal :temporary_redirect + with well-known code: 301 + is expected to equal :moved_permanently + with well-known code: 305 + is expected to equal :use_proxy + with well-known code: 451 + is expected to equal :unavailable_for_legal_reasons + with well-known code: 503 + is expected to equal :service_unavailable + with well-known code: 404 + is expected to equal :not_found + with well-known code: 226 + is expected to equal :im_used + with well-known code: 421 + is expected to equal :misdirected_request + with well-known code: 102 + is expected to equal :processing + with well-known code: 409 + is expected to equal :conflict + with well-known code: 303 + is expected to equal :see_other + with well-known code: 429 + is expected to equal :too_many_requests + with well-known code: 200 + is expected to equal :ok + with well-known code: 431 + is expected to equal :request_header_fields_too_large + with well-known code: 208 + is expected to equal :already_reported + with well-known code: 502 + is expected to equal :bad_gateway + with well-known code: 428 + is expected to equal :precondition_required + with well-known code: 406 + is expected to equal :not_acceptable + with well-known code: 501 + is expected to equal :not_implemented + with well-known code: 511 + is expected to equal :network_authentication_required + with well-known code: 400 + is expected to equal :bad_request + with well-known code: 205 + is expected to equal :reset_content + with well-known code: 201 + is expected to equal :created + with well-known code: 506 + is expected to equal :variant_also_negotiates + with well-known code: 206 + is expected to equal :partial_content + with well-known code: 407 + is expected to equal :proxy_authentication_required + with unknown code + is expected to be nil + with well-known code: 422 + is expected to equal :unprocessable_entity + with well-known code: 304 + is expected to equal :not_modified + with well-known code: 423 + is expected to equal :locked + with well-known code: 408 + is expected to equal :request_timeout + with well-known code: 426 + is expected to equal :upgrade_required + with well-known code: 411 + is expected to equal :length_required + #payload_too_large? + when code is higher than 413 is expected to equal false - when code is higher than 416 + when code is lower than 413 is expected to equal false - when code is 416 + when code is 413 is expected to equal true - #switching_protocols? - when code is 101 + #conflict? + when code is 409 is expected to equal true - when code is higher than 101 + when code is lower than 409 is expected to equal false - when code is lower than 101 + when code is higher than 409 is expected to equal false - #uri_too_long? - when code is 414 + with 5xx codes + is #server_error? + is not #redirect? + is not #informational? + is not #client_error? + is not #success? + with 4xx codes + is not #informational? + is #client_error? + is not #redirect? + is not #success? + is not #server_error? + #code + is expected to eq 200 + is expected to be a kind of Integer + #gone? + when code is 410 is expected to equal true - when code is lower than 414 + when code is lower than 410 is expected to equal false - when code is higher than 414 + when code is higher than 410 is expected to equal false - #method_not_allowed? - when code is 405 + #unavailable_for_legal_reasons? + when code is 451 is expected to equal true - when code is higher than 405 + when code is higher than 451 is expected to equal false - when code is lower than 405 + when code is lower than 451 is expected to equal false #inspect returns quoted code and reason phrase - with 3xx codes - is not #informational? - is #redirect? - is not #success? - is not #server_error? - is not #client_error? - ::SYMBOLS - [400] - is expected to equal :bad_request - [200] - is expected to equal :ok #http_version_not_supported? - when code is lower than 505 - is expected to equal false when code is 505 is expected to equal true when code is higher than 505 is expected to equal false - #precondition_required? - when code is higher than 428 - is expected to equal false - when code is lower than 428 + when code is lower than 505 is expected to equal false - when code is 428 + #network_authentication_required? + when code is 511 is expected to equal true - #continue? - when code is lower than 100 - is expected to equal false - when code is higher than 100 + when code is lower than 511 is expected to equal false - when code is 100 - is expected to equal true - #gone? - when code is 410 - is expected to equal true - when code is lower than 410 + when code is higher than 511 is expected to equal false - when code is higher than 410 + #found? + when code is higher than 302 is expected to equal false - #length_required? - when code is higher than 411 + when code is 302 + is expected to equal true + when code is lower than 302 is expected to equal false - when code is 411 + #continue? + when code is 100 is expected to equal true - when code is lower than 411 + when code is lower than 100 is expected to equal false - #accepted? - when code is higher than 202 + when code is higher than 100 is expected to equal false - when code is 202 + with 2xx codes + is not #informational? + is not #client_error? + is not #redirect? + is not #server_error? + is #success? + #temporary_redirect? + when code is higher than 307 + is expected to equal false + when code is 307 is expected to equal true - when code is lower than 202 + when code is lower than 307 is expected to equal false - #im_used? - when code is 226 + #processing? + when code is 102 is expected to equal true - when code is higher than 226 + when code is lower than 102 is expected to equal false - when code is lower than 226 + when code is higher than 102 is expected to equal false - with 1xx codes - is not #success? - is not #redirect? - is #informational? - is not #client_error? - is not #server_error? - .coerce - fails if coercion failed - is aliased as `.[]` - with Numeric - coerces as Fixnum code - with String - coerces reasons - fails when reason is unknown - with Symbol - fails when symbolized reason is unknown - coerces symbolized reasons #not_modified? when code is lower than 304 is expected to equal false @@ -3638,48 +4040,41 @@ is expected to equal true when code is higher than 304 is expected to equal false - #bad_request? - when code is 400 - is expected to equal true - when code is lower than 400 - is expected to equal false - when code is higher than 400 + #expectation_failed? + when code is higher than 417 is expected to equal false - #not_implemented? - when code is 501 + when code is 417 is expected to equal true - when code is lower than 501 + when code is lower than 417 is expected to equal false - when code is higher than 501 + #not_acceptable? + when code is lower than 406 is expected to equal false - #non_authoritative_information? - when code is 203 + when code is 406 is expected to equal true - when code is lower than 203 - is expected to equal false - when code is higher than 203 + when code is higher than 406 is expected to equal false - #upgrade_required? - when code is lower than 426 + #request_timeout? + when code is lower than 408 is expected to equal false - when code is higher than 426 + when code is higher than 408 is expected to equal false - when code is 426 + when code is 408 is expected to equal true - #reset_content? - when code is lower than 205 + #multiple_choices? + when code is higher than 300 is expected to equal false - when code is 205 + when code is 300 is expected to equal true - when code is higher than 205 - is expected to equal false - #proxy_authentication_required? - when code is higher than 407 + when code is lower than 300 is expected to equal false - when code is lower than 407 + #uri_too_long? + when code is lower than 414 is expected to equal false - when code is 407 + when code is 414 is expected to equal true + when code is higher than 414 + is expected to equal false #ok? when code is 200 is expected to equal true @@ -3687,311 +4082,139 @@ is expected to equal false when code is lower than 200 is expected to equal false - #payment_required? - when code is higher than 402 - is expected to equal false - when code is 402 - is expected to equal true - when code is lower than 402 - is expected to equal false - #too_many_requests? - when code is higher than 429 - is expected to equal false - when code is 429 + #not_extended? + when code is 510 is expected to equal true - when code is lower than 429 - is expected to equal false - #moved_permanently? - when code is lower than 301 + when code is lower than 510 is expected to equal false - when code is higher than 301 + when code is higher than 510 is expected to equal false - when code is 301 - is expected to equal true #unsupported_media_type? - when code is 415 - is expected to equal true when code is lower than 415 is expected to equal false when code is higher than 415 is expected to equal false - #multiple_choices? - when code is 300 + when code is 415 is expected to equal true - when code is lower than 300 - is expected to equal false - when code is higher than 300 + #insufficient_storage? + when code is lower than 507 is expected to equal false - #found? - when code is higher than 302 + when code is higher than 507 is expected to equal false - when code is lower than 302 + when code is 507 + is expected to equal true + #bad_request? + when code is higher than 400 is expected to equal false - when code is 302 + when code is 400 is expected to equal true - with 4xx codes - is not #informational? - is not #success? - is not #server_error? - is #client_error? - is not #redirect? - #gateway_timeout? - when code is higher than 504 + when code is lower than 400 is expected to equal false - when code is lower than 504 + #range_not_satisfiable? + when code is higher than 416 is expected to equal false - when code is 504 - is expected to equal true - #insufficient_storage? - when code is 507 + when code is 416 is expected to equal true - when code is lower than 507 + when code is lower than 416 is expected to equal false - when code is higher than 507 + #internal_server_error? + when code is lower than 500 is expected to equal false - with 2xx codes - is not #server_error? + when code is higher than 500 + is expected to equal false + when code is 500 + is expected to equal true + with 1xx codes is not #client_error? - is #success? is not #redirect? - is not #informational? - #request_header_fields_too_large? - when code is higher than 431 + is not #server_error? + is not #success? + is #informational? + #precondition_failed? + when code is higher than 412 is expected to equal false - when code is 431 - is expected to equal true - when code is lower than 431 + when code is lower than 412 is expected to equal false - #use_proxy? - when code is 305 + when code is 412 is expected to equal true - when code is lower than 305 - is expected to equal false - when code is higher than 305 - is expected to equal false - #multi_status? - when code is higher than 207 - is expected to equal false - when code is 207 + #precondition_required? + when code is 428 is expected to equal true - when code is lower than 207 + when code is lower than 428 + is expected to equal false + when code is higher than 428 is expected to equal false -HTTP - unifies socket errors into HTTP::ConnectionError - posting forms to resources - is easy - posting with an explicit body - is easy - .basic_auth - sets Authorization header with proper BasicAuth value - fails when :pass is not given - fails when :user is not given - fails when options is not a Hash - .auth - accepts any #to_s object - sets Authorization header to the given value - .cookies - properly merges Cookie headers and cookies - passes correct `Cookie` header - properly works with cookie jars from response - properly merges cookies - getting resources - is easy - with query string parameters - is easy - with URI instance - is easy - with two leading slashes in path - is allowed - with a large request body - with `.timeout(6)` - writes the whole body - with `.timeout(:null)` - writes the whole body - with `.timeout({:read=>2, :write=>2, :connect=>2})` - writes the whole body - with query string parameters in the URI and opts hash - includes both - with headers - is easy - .timeout - specifying a global timeout - sets timeout_class to Global - sets given timeout option - specifying a null timeout - sets timeout_class to Null - specifying per operation timeouts - sets timeout_class to PerOperation - sets given timeout options - .persistent - with host only given - example at ./spec/lib/http_spec.rb:260 (PENDING: Temporarily skipped with xit) - example at ./spec/lib/http_spec.rb:261 (PENDING: Temporarily skipped with xit) - with host and block given - returns last evaluation of last expression (PENDING: Temporarily skipped with xit) - auto-closes connection (PENDING: Temporarily skipped with xit) - with timeout specified - sets keep_alive_timeout - with redirects - is easy for 302 - is easy for 301 - .via - proxy with authentication - responds with 407 when wrong credentials given - responds with 407 if no credentials given - proxies the request - responds with the endpoint's body - ssl - responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) - responds with 407 if no credentials given (PENDING: Temporarily skipped with xcontext) - responds with 407 when wrong credentials given (PENDING: Temporarily skipped with xcontext) - anonymous proxy - ignores credentials - responds with the endpoint's body - raises an argument error if no port given - proxies the request - ssl - responds with the endpoint's body (PENDING: Temporarily skipped with xcontext) - ignores credentials (PENDING: Temporarily skipped with xcontext) - loading text with no charset - is binary encoded - .nodelay - sets TCP_NODELAY on the underlying socket - passing a string encoding type - finds encoding - .use - turns on given feature - with :auto_deflate - sends gzipped body - sends deflated body - with :normalize_uri - normalizes URI - uses the custom URI Normalizer method - uses the default URI normalizer - with :auto_inflate - returns deflated body - returns raw body when Content-Encoding type is missing - returns decoded body - head requests - is easy - loading binary data - is encoded as bytes - loading endpoint with charset - uses charset from headers - with encoding option - respects option - -HTTP::Options body - defaults to nil - may be specified with with_body +HTTP::Response::Parser + response in many parts + parses body + parses headers + whole response in one part + parses body + parses headers HTTP::Options new supports a Options instance with a Hash - coerces :response correctly + coerces :proxy correctly coerces :form correctly coerces :headers correctly - coerces :proxy correctly - -HTTP::Options - has reader methods for attributes - coerces to a Hash - -HTTP::Features::Instrumentation - logging the response - should log the response - logging the request - should log the request - -HTTP::Options headers - accepts any object that respond to :to_hash - defaults to be empty - may be specified with with_headers - -HTTP::Headers::Mixin - #headers - returns @headers instance variable - #[]= - proxies to headers#[] - #[] - proxies to headers#[] + coerces :response correctly -HTTP::Connection - #readpartial - reads data in parts - #read_headers! - reads data in parts +HTTP::Options form + may be specified with with_form_data + defaults to nil HTTP::Headers is Enumerable .coerce + accepts any object that respond to #to_a accepts any object that respond to #to_hash - accepts any object that respond to #to_h is aliased as .[] - accepts any object that respond to #to_a fails if given object cannot be coerced + accepts any object that respond to #to_h with duplicate header keys (mixed case) adds all headers - #merge! - leaves headers not presented in other as is - overwrites existing values - appends other headers, not presented in base - #get - returns array of associated values - fails with empty header name - fails with invalid header name - normalizes header name - when header does not exists - returns empty array - #set - allows set multiple values - fails with empty header name + #[]= sets header value - overwrites previous value - fails with invalid header name normalizes header name - #include? - normalizes given header name - tells whenever given headers is set or not - #inspect - is expected to eq "#[\"hoo=ray\", \"woo=hoo\"]}>" + overwrites previous value + allows set multiple values #to_a returns an Array returns Array of key/value pairs with normalized keys - #[]= - normalizes header name - allows set multiple values - sets header value - overwrites previous value #merge - is expected not to equal ["Host", "example.com"] and ["Accept", "application/json"] appends other headers, not presented in base - overwrites existing values - leaves headers not presented in other as is does not affects original headers + leaves headers not presented in other as is + is expected not to equal ["Host", "example.com"] and ["Accept", "application/json"] is expected to be a kind of HTTP::Headers - #add - appends new value if header exists + overwrites existing values + #set fails with invalid header name - normalizes header name + overwrites previous value fails with empty header name - allows append multiple values + normalizes header name + allows set multiple values sets header value - #hash - equals if two headers equals - #delete + #get fails with empty header name - removes given header + fails with invalid header name + returns array of associated values normalizes header name + when header does not exists + returns empty array + #merge! + appends other headers, not presented in base + leaves headers not presented in other as is + overwrites existing values + #add + fails with empty header name + normalizes header name + sets header value + appends new value if header exists + allows append multiple values fails with invalid header name - #dup - is expected to be a kind of HTTP::Headers - has headers copied - is expected not to equal ["Content-Type", "application/json"] - modifying a copy - does not affects original headers - modifies dupped copy #[] when header has a multiple values returns array of associated values @@ -4001,14 +4224,15 @@ normalizes header name when header does not exists returns nil - #keys - normalizes keys - returns uniq keys only + #inspect + is expected to eq "#[\"hoo=ray\", \"woo=hoo\"]}>" + #hash + equals if two headers equals #== + sensitive to headers order allows comparison with Array of key/value pairs - sensitive to header values order compares header keys and values - sensitive to headers order + sensitive to header values order .empty? when header exists is expected to equal false @@ -4016,604 +4240,416 @@ is expected to equal true initially is expected to equal true + #include? + tells whenever given headers is set or not + normalizes given header name + #dup + is expected not to equal ["Content-Type", "application/json"] + is expected to be a kind of HTTP::Headers + has headers copied + modifying a copy + modifies dupped copy + does not affects original headers + #delete + fails with invalid header name + removes given header + fails with empty header name + normalizes header name #each - returns self instance if block given yields headers in the same order they were added yields each key/value pair separatedly returns Enumerator if no block given + returns self instance if block given #to_h returns Hash with normalized keys returns a Hash - for a header with single value - provides a value as is for a header with multiple values provides an array of values + for a header with single value + provides a value as is + #keys + returns uniq keys only + normalizes keys -HTTP::Client - without timeouts - works - parsing params - does not corrupts index-less arrays - properly encodes colons - accepts params within the provided URL - does not convert newlines into \r\n before encoding string values - does not modifies query part if no params were given - combines GET params from the URI with the passed in params - merges duplicate values - #perform - calls finish_response once body was fully flushed - when uses chunked transfer encoding - properly reads body - with broken body (too early closed connection) - raises HTTP::ConnectionError - when server fully flushes response in one chunk - properly reads body - with HEAD request - does not iterates through body - finishes response after headers were received - working with SSL - just works (PENDING: Temporarily skipped with xdescribe) - fails with OpenSSL::SSL::SSLError if host mismatch (PENDING: Temporarily skipped with xdescribe) - with SSL options instead of a context - just works (PENDING: Temporarily skipped with xdescribe) - with a per operation timeout - works (PENDING: Temporarily skipped with xdescribe) - read - of 2.5 - does not time out (PENDING: Temporarily skipped with xdescribe) - of 0 - times out (PENDING: Temporarily skipped with xit) - connection - of 1 - does not time out (PENDING: Temporarily skipped with xdescribe) - without timeouts - works (PENDING: Temporarily skipped with xdescribe) - with a global timeout - errors if connecting takes too long (PENDING: Temporarily skipped with xdescribe) - errors if reading takes too long (PENDING: Temporarily skipped with xdescribe) - it resets state when reusing connections - does not timeout (PENDING: Temporarily skipped with xdescribe) - connection reuse - when enabled - re-uses the socket (PENDING: Temporarily skipped with xdescribe) - when trying to read a stale body - errors (PENDING: Temporarily skipped with xdescribe) - with a change in host - errors (PENDING: Temporarily skipped with xdescribe) - with a socket issue - transparently reopens (PENDING: Temporarily skipped with xdescribe) - on a mixed state - re-opens the connection (PENDING: Temporarily skipped with xdescribe) - without a host - infers host from persistent config (PENDING: Temporarily skipped with xdescribe) - when reading a cached body - succeeds (PENDING: Temporarily skipped with xdescribe) - when disabled - opens new sockets (PENDING: Temporarily skipped with xdescribe) - passing json - encodes given object - connection reuse - when disabled - opens new sockets - when enabled - re-uses the socket - when trying to read a stale body - errors - with a socket issue - transparently reopens - on a mixed state - re-opens the connection - with a change in host - errors - when reading a cached body - succeeds - without a host - infers host from persistent config - following redirects - fails upon endless redirects - fails if max amount of hops reached - returns response of new location - prepends previous request uri scheme and host if needed - with non-ASCII URLs - theoretically works like a charm (PENDING: Temporarily skipped with xit) - works like a charm in real world (PENDING: Temporarily skipped with xit) - with a per operation timeout - works - read - of 2.5 - does not time out - of 0 - times out (PENDING: Temporarily skipped with xit) - connection - of 1 - does not time out - with a global timeout - errors if connecting takes too long - errors if reading takes too long - it resets state when reusing connections - does not timeout - #request - with non-ASCII URLs - theoretically works like a charm (PENDING: Temporarily skipped with xit) - works like a charm in real world (PENDING: Temporarily skipped with xit) - with explicitly given `Host` header - keeps `Host` header as is (PENDING: Temporarily skipped with xit) - when :auto_deflate was specified - deletes Content-Length header - sets Content-Encoding header - and there is no body - doesn't set Content-Encoding header - passing multipart form data - creates url encoded form data object - creates multipart form data object - when passing an HTTP::FormData object directly - creates url encoded form data object +HTTP::Options json + defaults to nil + may be specified with with_json data -HTTP::Features::AutoDeflate - accepts deflate method - raises error for wrong type - accepts string as method - accepts gzip method - uses gzip by default - #deflated_body - when method is deflate - caches compressed content when size is called - returns object which yields deflated content of the given body - when method is gzip - returns object which yields gzipped content of the given body - caches compressed content when size is called +HTTP::Features::Logging + logging the request + should log the request + logging the response + should log the response + +HTTP::Options + has reader methods for attributes + coerces to a Hash + +HTTP::Response::Body + streams bodies from responses + when body empty + returns responds to empty? with true + when body is gzipped + decodes body + #readpartial + streams decoded body + #readpartial + returns content in specified encoding + with size given + passes value to underlying connection + without size given + does not blows up + calls underlying connection readpartial without specific size HTTP::Request - requires URI to have scheme part + provides a #scheme accessor includes HTTP::Headers::Mixin + requires URI to have scheme part provides a #verb accessor - provides a #scheme accessor sets given headers - User-Agent header - was not given - is expected to eq "http.rb/4.4.1" - was explicitly given - is expected to eq "MrCrawly/123" + #inspect + is expected to eq "#" #redirect presets new Host header + uri + is expected to eq # proxy is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - with schema-less absolute URL given - presets new Host header - proxy - is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - uri - is expected to eq # - verb - is expected to eq :post - body - is expected to eq # - verb - is expected to eq :post - body - is expected to eq # - with new verb given - verb - is expected to equal :get - with relative URL that misses leading slash given + with relative URL given keeps Host header + body + is expected to eq # verb is expected to eq :post uri - is expected to eq # - body - is expected to eq # + is expected to eq # with original URI having non-standard port uri - is expected to eq # + is expected to eq # proxy is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - uri - is expected to eq # - with URL with non-standard port given + verb + is expected to eq :post + with schema-less absolute URL given presets new Host header uri - is expected to eq # + is expected to eq # + body + is expected to eq # + verb + is expected to eq :post + proxy + is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} + with new verb given + verb + is expected to equal :get + with URL with non-standard port given + presets new Host header proxy is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - body - is expected to eq # verb is expected to eq :post - with relative URL given - keeps Host header + body + is expected to eq # uri - is expected to eq # + is expected to eq # + body + is expected to eq # + with relative URL that misses leading slash given + keeps Host header with original URI having non-standard port uri - is expected to eq # + is expected to eq # + body + is expected to eq # + uri + is expected to eq # proxy is expected to eq {:proxy_password=>"adams", :proxy_username=>"douglas"} - body - is expected to eq # verb is expected to eq :post #headline is expected to eq "GET /foo?bar=baz HTTP/1.1" - when URI contains encoded query - does not unencodes query part with proxy is expected to eq "GET http://example.com/foo?bar=baz HTTP/1.1" and HTTPS uri is expected to eq "GET /foo?bar=baz HTTP/1.1" - when URI contains fragment - omits fragment part when URI contains non-ASCII path encodes non-ASCII path part + when URI contains encoded query + does not unencodes query part + when URI contains fragment + omits fragment part Host header + was explicitly given + is expected to eq "github.com" was not given is expected to eq "example.com" and request URI has non-standard port is expected to eq "example.com:3000" + User-Agent header was explicitly given - is expected to eq "github.com" - #inspect - is expected to eq "#" - -HTTP::Response::Body - streams bodies from responses - when body is gzipped - decodes body - #readpartial - streams decoded body - #readpartial - returns content in specified encoding - without size given - does not blows up - calls underlying connection readpartial without specific size - with size given - passes value to underlying connection - when body empty - returns responds to empty? with true + is expected to eq "MrCrawly/123" + was not given + is expected to eq "http.rb/4.4.1" HTTP::Options merge - supports another Options - merges as excepted in complex cases supports a Hash + merges as excepted in complex cases + supports another Options + +HTTP::Options headers + may be specified with with_headers + accepts any object that respond to :to_hash + defaults to be empty HTTP::Options features + raises error for not supported features accepts feature name with its options in array accepts plain symbols in array defaults to be empty - raises error for not supported features - -HTTP::Features::Logging - logging the response - should log the response - logging the request - should log the request - -HTTP::ContentType - .parse - with tEXT/plaIN - charset - is expected to be nil - mime_type - is expected to eq "text/plain" - with text/plain; charset=utf-8 - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain; charSET=utf-8 - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain - charset - is expected to be nil - mime_type - is expected to eq "text/plain" - with text/plain; foo=bar; charset=utf-8 - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain; charset="utf-8" - charset - is expected to eq "utf-8" - mime_type - is expected to eq "text/plain" - with text/plain;charset=utf-8;foo=bar - mime_type - is expected to eq "text/plain" - charset - is expected to eq "utf-8" - -HTTP::Features::AutoInflate - #wrap_response - for x-gzip Content-Encoding header - returns a HTTP::Response wrapping the inflated response body - when there is no Content-Encoding header - returns original request - when response has uri - preserves uri in wrapped response - for unknown Content-Encoding header - returns original request - for gzip Content-Encoding header - returns a HTTP::Response wrapping the inflated response body - for deflate Content-Encoding header - returns a HTTP::Response wrapping the inflated response body - for identity Content-Encoding header - returns original request - -HTTP::Options proxy - defaults to {} - may be specified with with_proxy - accepts proxy address, port, username, and password - -HTTP::Options json - may be specified with with_json data - defaults to nil HTTP::Redirector - #max_hops - by default - is expected to eq 5 #perform + fails with StateError if there were no Location header + concatenates multiple Location headers fails with EndlessRedirectError if endless loop detected returns first non-redirect response - concatenates multiple Location headers fails with TooManyRedirectsError if max hops reached - fails with StateError if there were no Location header following 300 redirect - with non-strict mode - it follows with original verb if it's safe - it follows with GET if original request was DELETE - it follows with GET if original request was POST - it follows with GET if original request was PUT with strict mode - raises StateError if original request was POST - raises StateError if original request was DELETE it follows with original verb if it's safe + raises StateError if original request was DELETE raises StateError if original request was PUT + raises StateError if original request was POST + with non-strict mode + it follows with GET if original request was POST + it follows with original verb if it's safe + it follows with GET if original request was PUT + it follows with GET if original request was DELETE following 307 redirect follows with original request's verb following 301 redirect with non-strict mode - it follows with GET if original request was DELETE - it follows with original verb if it's safe - it follows with GET if original request was POST it follows with GET if original request was PUT - with strict mode - raises StateError if original request was POST - raises StateError if original request was DELETE - it follows with original verb if it's safe - raises StateError if original request was PUT - following 302 redirect - with non-strict mode - it follows with GET if original request was DELETE it follows with GET if original request was POST + it follows with GET if original request was DELETE it follows with original verb if it's safe - it follows with GET if original request was PUT with strict mode it follows with original verb if it's safe raises StateError if original request was PUT - raises StateError if original request was POST raises StateError if original request was DELETE + raises StateError if original request was POST following 303 redirect - follows with HEAD if original request was HEAD follows with GET if original request was GET follows with GET if original request was neither GET nor HEAD + follows with HEAD if original request was HEAD following 308 redirect follows with original request's verb + following 302 redirect + with strict mode + raises StateError if original request was PUT + it follows with original verb if it's safe + raises StateError if original request was DELETE + raises StateError if original request was POST + with non-strict mode + it follows with GET if original request was DELETE + it follows with GET if original request was PUT + it follows with GET if original request was POST + it follows with original verb if it's safe #strict by default is expected to equal true - -HTTP::Request::Writer - #stream - when Transfer-Encoding is chunked - writes encoded content and omits Content-Length - when writing to socket raises an exception - raises a ConnectionError - when server won't accept any more data - aborts silently - when multiple headers are set - separates headers with carriage return and line feed - when body is nonempty - writes it to the socket and sets Content-Length - when body is empty - doesn't write anything to the socket and sets Content-Length - when Content-Length header is set - keeps the given value - -HTTP::Options form - may be specified with with_form_data - defaults to nil + #max_hops + by default + is expected to eq 5 Pending: (Failures listed here are expected and do not affect your suite's status) - 1) HTTP.persistent with host only given + 1) HTTP::Client#request with non-ASCII URLs theoretically works like a charm # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:260 + # ./spec/lib/http/client_spec.rb:225 - 2) HTTP.persistent with host only given + 2) HTTP::Client#request with non-ASCII URLs works like a charm in real world # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:261 + # ./spec/lib/http/client_spec.rb:230 - 3) HTTP.persistent with host and block given returns last evaluation of last expression + 3) HTTP::Client#request with explicitly given `Host` header keeps `Host` header as is # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:265 + # ./spec/lib/http/client_spec.rb:241 - 4) HTTP.persistent with host and block given auto-closes connection + 4) HTTP::Client with a per operation timeout read of 0 times out # Temporarily skipped with xit - # ./spec/lib/http_spec.rb:269 - - 5) HTTP.via proxy with authentication ssl responds with the endpoint's body - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:135 - - 6) HTTP.via proxy with authentication ssl responds with 407 if no credentials given - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:145 - - 7) HTTP.via proxy with authentication ssl responds with 407 when wrong credentials given - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:140 - - 8) HTTP.via anonymous proxy ssl responds with the endpoint's body - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:99 + # ./spec/support/http_handling_shared.rb:47 - 9) HTTP.via anonymous proxy ssl ignores credentials - # Temporarily skipped with xcontext - # ./spec/lib/http_spec.rb:104 + 5) HTTP::Client working with SSL fails with OpenSSL::SSL::SSLError if host mismatch + # Temporarily skipped with xdescribe + # ./spec/lib/http/client_spec.rb:309 - 10) HTTP::Client working with SSL just works + 6) HTTP::Client working with SSL just works # Temporarily skipped with xdescribe # ./spec/lib/http/client_spec.rb:304 - 11) HTTP::Client working with SSL fails with OpenSSL::SSL::SSLError if host mismatch + 7) HTTP::Client working with SSL with a global timeout errors if reading takes too long # Temporarily skipped with xdescribe - # ./spec/lib/http/client_spec.rb:309 + # ./spec/support/http_handling_shared.rb:83 - 12) HTTP::Client working with SSL with SSL options instead of a context just works + 8) HTTP::Client working with SSL with a global timeout errors if connecting takes too long # Temporarily skipped with xdescribe - # ./spec/lib/http/client_spec.rb:319 + # ./spec/support/http_handling_shared.rb:75 - 13) HTTP::Client working with SSL with a per operation timeout works + 9) HTTP::Client working with SSL with a global timeout it resets state when reusing connections does not timeout # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:29 + # ./spec/support/http_handling_shared.rb:93 - 14) HTTP::Client working with SSL with a per operation timeout read of 2.5 does not time out + 10) HTTP::Client working with SSL without timeouts works # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:55 - - 15) HTTP::Client working with SSL with a per operation timeout read of 0 times out - # Temporarily skipped with xit - # ./spec/support/http_handling_shared.rb:47 + # ./spec/support/http_handling_shared.rb:7 - 16) HTTP::Client working with SSL with a per operation timeout connection of 1 does not time out + 11) HTTP::Client working with SSL with a per operation timeout works # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:37 + # ./spec/support/http_handling_shared.rb:29 - 17) HTTP::Client working with SSL without timeouts works + 12) HTTP::Client working with SSL with a per operation timeout connection of 1 does not time out # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:7 + # ./spec/support/http_handling_shared.rb:37 - 18) HTTP::Client working with SSL with a global timeout errors if connecting takes too long - # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:75 + 13) HTTP::Client working with SSL with a per operation timeout read of 0 times out + # Temporarily skipped with xit + # ./spec/support/http_handling_shared.rb:47 - 19) HTTP::Client working with SSL with a global timeout errors if reading takes too long + 14) HTTP::Client working with SSL with a per operation timeout read of 2.5 does not time out # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:83 + # ./spec/support/http_handling_shared.rb:55 - 20) HTTP::Client working with SSL with a global timeout it resets state when reusing connections does not timeout + 15) HTTP::Client working with SSL with SSL options instead of a context just works # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:93 + # ./spec/lib/http/client_spec.rb:319 - 21) HTTP::Client working with SSL connection reuse when enabled re-uses the socket + 16) HTTP::Client working with SSL connection reuse when enabled re-uses the socket # Temporarily skipped with xdescribe # ./spec/support/http_handling_shared.rb:117 - 22) HTTP::Client working with SSL connection reuse when enabled when trying to read a stale body errors + 17) HTTP::Client working with SSL connection reuse when enabled with a socket issue transparently reopens # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:135 + # ./spec/support/http_handling_shared.rb:154 - 23) HTTP::Client working with SSL connection reuse when enabled with a change in host errors + 18) HTTP::Client working with SSL connection reuse when enabled when reading a cached body succeeds # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:175 + # ./spec/support/http_handling_shared.rb:142 - 24) HTTP::Client working with SSL connection reuse when enabled with a socket issue transparently reopens + 19) HTTP::Client working with SSL connection reuse when enabled when trying to read a stale body errors # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:154 + # ./spec/support/http_handling_shared.rb:135 - 25) HTTP::Client working with SSL connection reuse when enabled on a mixed state re-opens the connection + 20) HTTP::Client working with SSL connection reuse when enabled on a mixed state re-opens the connection # Temporarily skipped with xdescribe # ./spec/support/http_handling_shared.rb:123 - 26) HTTP::Client working with SSL connection reuse when enabled without a host infers host from persistent config + 21) HTTP::Client working with SSL connection reuse when enabled without a host infers host from persistent config # Temporarily skipped with xdescribe # ./spec/support/http_handling_shared.rb:112 - 27) HTTP::Client working with SSL connection reuse when enabled when reading a cached body succeeds + 22) HTTP::Client working with SSL connection reuse when enabled with a change in host errors # Temporarily skipped with xdescribe - # ./spec/support/http_handling_shared.rb:142 + # ./spec/support/http_handling_shared.rb:175 - 28) HTTP::Client working with SSL connection reuse when disabled opens new sockets + 23) HTTP::Client working with SSL connection reuse when disabled opens new sockets # Temporarily skipped with xdescribe # ./spec/support/http_handling_shared.rb:184 - 29) HTTP::Client following redirects with non-ASCII URLs theoretically works like a charm + 24) HTTP::Client following redirects with non-ASCII URLs theoretically works like a charm # Temporarily skipped with xit # ./spec/lib/http/client_spec.rb:91 - 30) HTTP::Client following redirects with non-ASCII URLs works like a charm in real world + 25) HTTP::Client following redirects with non-ASCII URLs works like a charm in real world # Temporarily skipped with xit # ./spec/lib/http/client_spec.rb:100 - 31) HTTP::Client with a per operation timeout read of 0 times out + 26) HTTP.via proxy with authentication ssl responds with the endpoint's body + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:135 + + 27) HTTP.via proxy with authentication ssl responds with 407 when wrong credentials given + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:140 + + 28) HTTP.via proxy with authentication ssl responds with 407 if no credentials given + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:145 + + 29) HTTP.via anonymous proxy ssl ignores credentials + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:104 + + 30) HTTP.via anonymous proxy ssl responds with the endpoint's body + # Temporarily skipped with xcontext + # ./spec/lib/http_spec.rb:99 + + 31) HTTP.persistent with host and block given returns last evaluation of last expression # Temporarily skipped with xit - # ./spec/support/http_handling_shared.rb:47 + # ./spec/lib/http_spec.rb:265 - 32) HTTP::Client#request with non-ASCII URLs theoretically works like a charm + 32) HTTP.persistent with host and block given auto-closes connection # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:225 + # ./spec/lib/http_spec.rb:269 - 33) HTTP::Client#request with non-ASCII URLs works like a charm in real world + 33) HTTP.persistent with host only given # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:230 + # ./spec/lib/http_spec.rb:261 - 34) HTTP::Client#request with explicitly given `Host` header keeps `Host` header as is + 34) HTTP.persistent with host only given # Temporarily skipped with xit - # ./spec/lib/http/client_spec.rb:241 + # ./spec/lib/http_spec.rb:260 -Top 10 slowest examples (10.42 seconds, 78.8% of total time): +Top 10 slowest examples (10.6 seconds, 79.9% of total time): HTTP::Client with a global timeout it resets state when reusing connections does not timeout 4.06 seconds ./spec/support/http_handling_shared.rb:93 + HTTP unifies socket errors into HTTP::ConnectionError + 2.15 seconds ./spec/lib/http_spec.rb:455 HTTP::Client with a per operation timeout read of 2.5 does not time out 2.01 seconds ./spec/support/http_handling_shared.rb:55 - HTTP unifies socket errors into HTTP::ConnectionError - 1.98 seconds ./spec/lib/http_spec.rb:455 HTTP::Client with a global timeout errors if reading takes too long 1.01 seconds ./spec/support/http_handling_shared.rb:83 HTTP::Client with a global timeout errors if connecting takes too long 1.01 seconds ./spec/support/http_handling_shared.rb:75 - HTTP getting resources with a large request body with `.timeout(6)` writes the whole body - 0.08857 seconds ./spec/lib/http_spec.rb:64 HTTP getting resources with a large request body with `.timeout({:read=>2, :write=>2, :connect=>2})` writes the whole body - 0.08378 seconds ./spec/lib/http_spec.rb:64 - HTTP getting resources with a large request body with `.timeout(:null)` writes the whole body - 0.06546 seconds ./spec/lib/http_spec.rb:64 - HTTP::Client connection reuse when enabled re-uses the socket - 0.05612 seconds ./spec/support/http_handling_shared.rb:117 + 0.08581 seconds ./spec/lib/http_spec.rb:64 + HTTP getting resources with a large request body with `.timeout(6)` writes the whole body + 0.07692 seconds ./spec/lib/http_spec.rb:64 + HTTP::Features::Instrumentation logging the request should log the request + 0.07045 seconds ./spec/lib/http/features/instrumentation_spec.rb:17 HTTP::Client connection reuse when enabled when reading a cached body succeeds - 0.05585 seconds ./spec/support/http_handling_shared.rb:142 + 0.06767 seconds ./spec/support/http_handling_shared.rb:142 + HTTP getting resources with a large request body with `.timeout(:null)` writes the whole body + 0.05978 seconds ./spec/lib/http_spec.rb:64 Top 10 slowest example groups: HTTP::Client - 0.13364 seconds average (8.55 seconds / 64 examples) ./spec/lib/http/client_spec.rb:8 + 0.13376 seconds average (8.56 seconds / 64 examples) ./spec/lib/http/client_spec.rb:8 HTTP - 0.04469 seconds average (2.82 seconds / 63 examples) ./spec/lib/http_spec.rb:9 + 0.04728 seconds average (2.98 seconds / 63 examples) ./spec/lib/http_spec.rb:9 + HTTP::Features::Instrumentation + 0.03898 seconds average (0.07795 seconds / 2 examples) ./spec/lib/http/features/instrumentation_spec.rb:3 + HTTP::Options proxy + 0.00968 seconds average (0.02904 seconds / 3 examples) ./spec/lib/http/options/proxy_spec.rb:3 + HTTP::ContentType + 0.00841 seconds average (0.11778 seconds / 14 examples) ./spec/lib/http/content_type_spec.rb:3 HTTP::Connection - 0.00797 seconds average (0.01594 seconds / 2 examples) ./spec/lib/http/connection_spec.rb:3 + 0.00708 seconds average (0.01415 seconds / 2 examples) ./spec/lib/http/connection_spec.rb:3 + HTTP::Request::Writer + 0.00505 seconds average (0.03534 seconds / 7 examples) ./spec/lib/http/request/writer_spec.rb:4 HTTP::Response::Parser - 0.00714 seconds average (0.02855 seconds / 4 examples) ./spec/lib/http/response/parser_spec.rb:3 - HTTP::Response - 0.00562 seconds average (0.14057 seconds / 25 examples) ./spec/lib/http/response_spec.rb:3 + 0.00389 seconds average (0.01558 seconds / 4 examples) ./spec/lib/http/response/parser_spec.rb:3 HTTP::Request - 0.00373 seconds average (0.16766 seconds / 45 examples) ./spec/lib/http/request_spec.rb:4 - HTTP::Headers - 0.00366 seconds average (0.27085 seconds / 74 examples) ./spec/lib/http/headers_spec.rb:3 - HTTP::Redirector - 0.00326 seconds average (0.11743 seconds / 36 examples) ./spec/lib/http/redirector_spec.rb:3 - HTTP::ContentType - 0.00317 seconds average (0.04445 seconds / 14 examples) ./spec/lib/http/content_type_spec.rb:3 - HTTP::Response::Body - 0.00304 seconds average (0.0243 seconds / 8 examples) ./spec/lib/http/response/body_spec.rb:3 + 0.00359 seconds average (0.16135 seconds / 45 examples) ./spec/lib/http/request_spec.rb:4 + HTTP::Features::AutoInflate + 0.00358 seconds average (0.02508 seconds / 7 examples) ./spec/lib/http/features/auto_inflate_spec.rb:3 -Finished in 13.21 seconds (files took 3.08 seconds to load) +Finished in 13.27 seconds (files took 2.64 seconds to load) 811 examples, 0 failures, 34 pending -Randomized with seed 36772 +Randomized with seed 33146 Coverage report generated for RSpec to /build/reproducible-path/ruby-http-4.4.1/coverage. 1268 / 1361 LOC (93.17%) covered. [Coveralls] Outside the CI environment, not sending data. @@ -4650,12 +4686,14 @@ dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/B01_cleanup starting +I: user script /srv/workspace/pbuilder/29431/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env -I: removing directory /srv/workspace/pbuilder/4145 and its subdirectories -I: Current time: Sun Feb 2 18:43:03 -12 2025 -I: pbuilder-time-stamp: 1738564983 +I: removing directory /srv/workspace/pbuilder/29431 and its subdirectories +I: Current time: Mon Feb 3 20:47:24 +14 2025 +I: pbuilder-time-stamp: 1738565244