Lines Matching full:to

2 # Licensed to the Apache Software Foundation (ASF) under one
6 # to you under the Apache License, Version 2.0 (the
12 # Unless required by applicable law or agreed to in writing,
24 expect(@socket.open).to eq(@handle)
30 expect(@socket).to be_open
38 it "should write data to the handle" do
40 expect(@handle).to receive(:write).with("foobar")
42 expect(@handle).to receive(:write).with("fail").and_raise(StandardError)
43 …expect { @socket.write("fail") }.to raise_error(Thrift::TransportException) { |e| expect(e.type).t…
48 expect(@handle).to receive(:readpartial).with(17).and_raise(StandardError)
49 …expect { @socket.read(17) }.to raise_error(Thrift::TransportException) { |e| expect(e.type).to eq(…
54 expect(@handle).to receive(:readpartial).with(17).and_return("test data")
55 expect(@socket.read(17)).to eq("test data")
60 expect(@handle).to receive(:write).with("fail").and_raise(StandardError)
61 expect(@socket).to be_open
62 …expect { @socket.write("fail") }.to raise_error(Thrift::TransportException) { |e| expect(e.type).t…
68 allow(@handle).to receive(:closed?).and_return(true)
70 expect { @socket.write("fail") }.to raise_error(IOError, "closed stream")
71 expect { @socket.read(10) }.to raise_error(IOError, "closed stream")
77 expect(IO).to receive(:select).with([@handle], nil, nil, 3).and_return([[@handle], [], []])
78 expect(@handle).to receive(:readpartial).with(17).and_return("test data")
79 expect(@socket.read(17)).to eq("test data")
85 … expect(IO).to receive(:select).with(nil, [@handle], nil, 3).twice.and_return([[], [@handle], []])
86 expect(@handle).to receive(:write_nonblock).with("test data").and_return(4)
87 expect(@handle).to receive(:write_nonblock).with(" data").and_return(5)
88 expect(@socket.write("test data")).to eq(9)
94 expect(IO).to receive(:select).once {sleep(0.5); nil}
95 …expect { @socket.read(17) }.to raise_error(Thrift::TransportException) { |e| expect(e.type).to eq(…
101 allow(IO).to receive(:select).with(nil, [@handle], nil, 0.5).and_return(nil)
102 …expect { @socket.write("test data") }.to raise_error(Thrift::TransportException) { |e| expect(e.ty…