Fix ruby 4 header regression#117
Conversation
| { | ||
| Authorization: "Bearer #{BreezyPDFLite.secret_api_key}" | ||
| "Authorization" => "Bearer #{BreezyPDFLite.secret_api_key}", | ||
| "Content-Type" => "application/x-www-form-urlencoded" |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| def headers | ||
| { | ||
| Authorization: "Bearer #{BreezyPDFLite.secret_api_key}" | ||
| "Authorization" => "Bearer #{BreezyPDFLite.secret_api_key}", |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| tested_class.new.post("/foo", "bob") | ||
|
|
||
| request.exec(socket, "1.1", request.path) | ||
| assert_match(/\r\nContent-Type: application\/x-www-form-urlencoded\r\n/i, written) |
There was a problem hiding this comment.
Style/RegexpLiteral: Use %r around regular expression.
Metrics/LineLength: Line is too long. [86/80]
| Net::HTTP.expects(:new).returns(http_mock) | ||
| tested_class.new.post("/foo", "bob") | ||
|
|
||
| request.exec(socket, "1.1", request.path) |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| http_mock.expects(:request).with { |net_http_request| request = net_http_request } | ||
|
|
||
| Net::HTTP.expects(:new).returns(http_mock) | ||
| tested_class.new.post("/foo", "bob") |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| strings.sum(&:bytesize) | ||
| end | ||
|
|
||
| http_mock = mock("HTTP") |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
|
|
||
| def test_post_sends_form_content_type | ||
| request = nil | ||
| written = +"" |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| tested_class.new.post(path, body) | ||
| end | ||
|
|
||
| def test_post_sends_form_content_type |
There was a problem hiding this comment.
Metrics/AbcSize: Assignment Branch Condition size for test_post_sends_form_content_type is too high. [26.48/15]
Metrics/MethodLength: Method has too many lines. [17/10]
| headers = { | ||
| Authorization: "Bearer #{BreezyPDFLite.secret_api_key}" | ||
| "Authorization" => "Bearer #{BreezyPDFLite.secret_api_key}", | ||
| "Content-Type" => "application/x-www-form-urlencoded" |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
| uri = URI.parse(BreezyPDFLite.base_url + path) | ||
| headers = { | ||
| Authorization: "Bearer #{BreezyPDFLite.secret_api_key}" | ||
| "Authorization" => "Bearer #{BreezyPDFLite.secret_api_key}", |
There was a problem hiding this comment.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
No description provided.