Add unit tests for SSE::ConnectionProxy#245
Merged
rsamoilov merged 1 commit intorage-rb:mainfrom Mar 25, 2026
Merged
Conversation
Add comprehensive unit tests for Rage::SSE::ConnectionProxy, covering all public methods: write, <<, close, close_write, closed?, flush, read, and close_read. This is the only SSE component without dedicated unit test coverage.
1cea1c5 to
5306cf4
Compare
rsamoilov
approved these changes
Mar 25, 2026
Member
rsamoilov
left a comment
There was a problem hiding this comment.
The tests look good! Thank you for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rage::SSE::ConnectionProxy— the only SSE component without dedicated unit test coveragewrite,<<,close,close_write,closed?,flush,read,close_readMockConnectionthat mirrors Iodine's connection interface (write,close,open?)Context
While reading through the SSE implementation, I noticed that every other SSE component has dedicated specs:
spec/sse/sse_spec.rb— testsRage::SSE.__serializeand.messagespec/sse/message_spec.rb— testsRage::SSE::Message#to_sspec/controller/api/sse_spec.rb— tests controller-level SSE renderingspec/integration/sse_spec.rb— end-to-end SSE testsBut
ConnectionProxyhad none. These tests verify the proxy correctly delegates to the underlying connection, converts data viato_s, raisesIOErroron closed streams, and that no-op methods (read,close_read) behave as expected.Test plan
bundle exec rspec spec/sse/connection_proxy_spec.rb— 15 examples, 0 failuresbundle exec rspec spec/sse/— 44 examples, 0 failures (all existing SSE tests still pass)