Created
February 26, 2016 12:14
-
-
Save dougneal/cad41d0e4066a151de11 to your computer and use it in GitHub Desktop.
rspec: socket mocking
This file contains 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
socket = class_double(TCPSocket) | |
expect(socket).to receive(:is_a?).with(TCPSocket) { true } | |
expect(TCPSocket).to receive(:new) { socket } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment