Copilot commented on code in PR #3725:
URL: https://github.com/apache/thrift/pull/3725#discussion_r3792739020
##########
lib/rb/spec/socket_spec_shared.rb:
##########
@@ -121,15 +121,15 @@
@socket.timeout = 0.5
@socket.open
expect(@handle).to
receive(:read_nonblock).with(17).and_raise(IO::EAGAINWaitReadable)
- expect(IO).to receive(:select).once { sleep(0.6); nil }
+ expect(IO).to(receive(:select).once { sleep(0.6); nil })
Review Comment:
This expectation wraps the matcher in `to(...)` but still passes the `{ ...
}` block to `.once`, which is non-idiomatic and makes it unclear which call
owns the stub implementation. Prefer `and_wrap_original` (used elsewhere in the
specs) so the sleep/return behavior is unambiguous and not reliant on block
forwarding through `.once`.
This issue also appears on line 132 of the same file.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]