Skip to content

Commit f396cee

Browse files
committed
Add tests for argumentless IO#read
1 parent 9f99cec commit f396cee

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

spec/tcr_spec.rb

+11
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,17 @@
222222
end
223223
end
224224

225+
it "stubs out Socket#read correctly" do
226+
TCR.configure { |c|
227+
c.hook_tcp_ports = [23]
228+
}
229+
TCR.use_cassette("spec/fixtures/starwars_telnet") do
230+
sock = TCPSocket.open("towel.blinkenlights.nl", 23)
231+
expect(sock.read.length).to_not be_zero
232+
sock.close
233+
end
234+
end
235+
225236
it "supports ssl sockets" do
226237
TCR.configure { |c| c.hook_tcp_ports = [443] }
227238
http = Net::HTTP.new("www.google.com", 443)

0 commit comments

Comments
 (0)