Skip to content

Commit 6ebb06c

Browse files
justin808claude
andcommitted
Fix HTTPError initialization in integration test
The HTTPX::HTTPError constructor expects a single response object argument, not two separate arguments. Updated the test to properly create an ErrorResponse object and pass it to HTTPError. This fixes the test failure: ArgumentError: wrong number of arguments (given 2, expected 1) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 2b006af commit 6ebb06c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

react_on_rails_pro/spec/react_on_rails_pro/request_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,12 @@
246246
mock_streaming_response(render_full_url, 200) do |yielder|
247247
yielder.call("#{original_chunks[0]}\n")
248248
# Simulate connection error mid-stream
249-
raise HTTPX::HTTPError.new("Connection error", nil)
249+
# HTTPError expects a response object, so create a mock error response
250+
error_response = HTTPX::ErrorResponse.new(
251+
HTTPX::Request.new("POST", render_full_url),
252+
StandardError.new("Connection closed")
253+
)
254+
raise HTTPX::HTTPError, error_response
250255
end
251256
else
252257
# Second attempt: complete all chunks successfully

0 commit comments

Comments
 (0)