Commit 3de5cb5
Fix client disconnect test to properly simulate stream.closed?
The test "stops producing when client disconnects" was failing because
the .closed? stub always returned false, so producers never detected
the disconnect.
Changes:
- Add stream_closed flag that starts as false
- Set stream_closed = true when IOError is raised (2nd write)
- Update .closed? stub to return the stream_closed flag value
- Move IOError raise before adding chunk to written_chunks
(so written_chunks.count == 1 as expected, not 2)
This properly simulates the real behavior where stream.closed? returns
true after a write error, allowing producers to detect disconnect and
stop producing.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent d1c9028 commit 3de5cb5
File tree
1 file changed
+8
-1
lines changed- react_on_rails_pro/spec/dummy/spec/helpers
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| 523 | + | |
523 | 524 | | |
524 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
525 | 530 | | |
526 | | - | |
527 | 531 | | |
528 | 532 | | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
529 | 536 | | |
530 | 537 | | |
531 | 538 | | |
| |||
0 commit comments