Skip to content

refactor: improve ruby example #884

refactor: improve ruby example

refactor: improve ruby example #884

Re-run triggered November 4, 2025 00:06
Status Failure
Total duration 22s
Artifacts

ci.yml

on: pull_request
Matrix: build
Fit to window
Zoom out
Zoom in

Annotations

23 errors
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "multipart-data.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001' - request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"src/fixtures/files/hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bar\"\r\n\r\nBonjour le monde\r\n-----011000010111000001101001--" + request.body = -----011000010111000001101001 + Content-Disposition: form-data; name="foo"; filename="src/fixtures/files/hello.txt" + Content-Type: text/plain + + Hello World + -----011000010111000001101001 + Content-Disposition: form-data; name="bar" + + Bonjour le monde + -----011000010111000001101001--.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "jsonObj-null-value.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/json' - request.body = "{\"foo\":null}" + request.body = {"foo":null}.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "jsonObj-multiline.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/json' - request.body = "{\n \"foo\": \"bar\"\n}" + request.body = { + "foo": "bar" + }.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "http-insecure.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("http://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "headers.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/headers") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "full.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything?foo=bar&foo=baz&baz=abc&key=value") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["cookie"] = 'foo=bar; bar=baz' request["accept"] = 'application/json' request["content-type"] = 'application/x-www-form-urlencoded' - request.body = "foo=bar" + request.body = foo=bar.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "custom-method.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' class Net::HTTP::Propfind < Net::HTTPRequest METHOD = 'PROPFIND' REQUEST_HAS_BODY = 'false' RESPONSE_HAS_BODY = true ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "cookies.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/cookies") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "application-json.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/json' - request.body = "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":[]}],\"boolean\":false}" + request.body = {"number":1,"string":"f\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":[]}],"boolean":false}.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "application-form-encoded.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/x-www-form-urlencoded' - request.body = "foo=bar&hello=world" + request.body = foo=bar&hello=world.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
build (latest)
The strategy configuration was canceled because "build.lts_-1" failed
build (latest)
The operation was canceled.
build (lts/*)
The strategy configuration was canceled because "build.lts_-1" failed
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "multipart-data.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001' - request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"src/fixtures/files/hello.txt\"\r\nContent-Type: text/plain\r\n\r\nHello World\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"bar\"\r\n\r\nBonjour le monde\r\n-----011000010111000001101001--" + request.body = -----011000010111000001101001 + Content-Disposition: form-data; name="foo"; filename="src/fixtures/files/hello.txt" + Content-Type: text/plain + + Hello World + -----011000010111000001101001 + Content-Disposition: form-data; name="bar" + + Bonjour le monde + -----011000010111000001101001--.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "jsonObj-null-value.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/json' - request.body = "{\"foo\":null}" + request.body = {"foo":null}.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "jsonObj-multiline.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/json' - request.body = "{\n \"foo\": \"bar\"\n}" + request.body = { + "foo": "bar" + }.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "http-insecure.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("http://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "headers.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/headers") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "full.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything?foo=bar&foo=baz&baz=abc&key=value") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["cookie"] = 'foo=bar; bar=baz' request["accept"] = 'application/json' request["content-type"] = 'application/x-www-form-urlencoded' - request.body = "foo=bar" + request.body = foo=bar.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "custom-method.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' class Net::HTTP::Propfind < Net::HTTPRequest METHOD = 'PROPFIND' REQUEST_HAS_BODY = 'false' RESPONSE_HAS_BODY = true ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "cookies.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received @@ -1,7 +1,8 @@ require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/cookies") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "application-json.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/json' - request.body = "{\"number\":1,\"string\":\"f\\\"oo\",\"arr\":[1,2,3],\"nested\":{\"a\":\"b\"},\"arr_mix\":[1,\"a\",{\"arr_mix_nested\":[]}],\"boolean\":false}" + request.body = {"number":1,"string":"f\"oo","arr":[1,2,3],"nested":{"a":"b"},"arr_mix":[1,"a",{"arr_mix_nested":[]}],"boolean":false}.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28
src/targets/index.test.ts > request validation > ruby > native > request should match fixture for "application-form-encoded.js": src/targets/index.test.ts#L108
AssertionError: expected 'require \'uri\'\nrequire \'net/http\'…' to strictly equal 'require \'uri\'\nrequire \'net/http\'…' - Expected + Received require 'uri' - require 'net/http' + require 'net/http' + require 'json' url = URI("https://httpbin.org/anything") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["content-type"] = 'application/x-www-form-urlencoded' - request.body = "foo=bar&hello=world" + request.body = foo=bar&hello=world.to_json response = http.request(request) puts response.read_body ❯ src/targets/index.test.ts:108:28