spec/channel_spec.rb in zmachine-0.3.2 vs spec/channel_spec.rb in zmachine-0.4.0
- old
+ new
@@ -42,11 +42,11 @@
@client.finish_connecting
end
it 'writes outbound buffers to the socket' do
@client.send_data(data)
- expect(@client.write_outbound_data).to eq(true)
+ expect(@client.can_send?).to eq(true)
end
it 'receives data sent from the client' do
@client.send_data(data)
@client.write_outbound_data
@@ -82,20 +82,10 @@
channel = @server.accept
channel.close
expect(channel).to be_closed
end
- it 'closes the connection after writing' do
- @server.accept
- @client.finish_connecting
- @client.send_data(data)
- @client.close(true)
- expect(@client).to be_connected
- @client.write_outbound_data
- expect(@client).not_to be_connected
- end
-
end
end
describe TCPChannel do
@@ -133,12 +123,12 @@
it 'reads data after server has closed connection' do
channel = @server.accept
@client.finish_connecting
channel.send_data(data)
- channel.close(true)
- expect(channel).to be_connected
channel.write_outbound_data
+ expect(channel).to be_connected
+ channel.close
expect(channel).not_to be_connected
expect(@client).to be_connected
@client.read_inbound_data
expect{@client.read_inbound_data}.to raise_error(IOException)
end