Skip to content

Fix MockResponse#body when the body is a Proc#2420

Merged
ioquatix merged 1 commit intorack:mainfrom
tavianator:fix-mock-response-proc-body
Jan 24, 2026
Merged

Fix MockResponse#body when the body is a Proc#2420
ioquatix merged 1 commit intorack:mainfrom
tavianator:fix-mock-response-proc-body

Conversation

@tavianator
Copy link
Copy Markdown
Contributor

Previously, we would see errors like

NoMethodError: undefined method 'each' for an instance of Proc

in Rails integration tests when using streaming response bodies.

Previously, we would see errors like

    NoMethodError: undefined method 'each' for an instance of Proc

in Rails integration tests when using streaming response bodies.
@jeremyevans jeremyevans requested a review from ioquatix January 23, 2026 17:24
@ioquatix
Copy link
Copy Markdown
Member

I think this is a good step in the right direction, but we might want to also consider how a user might test actual bi-directional communication.

@ioquatix ioquatix merged commit 6e483c4 into rack:main Jan 24, 2026
16 checks passed
ioquatix added a commit that referenced this pull request Feb 12, 2026
ioquatix pushed a commit that referenced this pull request Feb 12, 2026
- Ensure streaming response body is closed by `Rack::MockResponse`. (#2423)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants