rspec / rspec-core

RSpec runner and formatters
http://rspec.info
MIT License
1.21k stars 756 forks source link

Use __send__ instead of send #3045

Closed richardplatel closed 10 months ago

richardplatel commented 10 months ago

RSpec::Core::OutputWrapper uses send to call class methods on IO objects, but some IO objects (e.g. TCPSocket) redefine send. Use the equivalent __send__ method instead.

https://apidock.com/ruby/BasicObject/__send__

richardplatel commented 10 months ago

@pirj Could use some help here figuring out how to write this test.

Seems like making a real TCPSocket is not ideal but I'm not sure how to mock it in a way that still tests the change.

Or maybe there another approach?

JonRowe commented 10 months ago

Thanks for spotting this, I've merged your commit with an updated spec. (0ff6358ef15ded1eb67e4796f94f5be95dcf00e7)

JonRowe commented 3 months ago

This has been released in 3.12.3, sorry about the delay