1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2021-01-28 17:08:57 +01:00
parent 1b377b32c8
commit 2e32b919b4
35 changed files with 832 additions and 10 deletions

View file

@ -99,6 +99,14 @@ describe 'BasicSocket#send' do
@server.close
end
describe 'with an object implementing #to_str' do
it 'returns the amount of sent bytes' do
data = mock('message')
data.should_receive(:to_str).and_return('hello')
@client.send(data, 0, @server.getsockname).should == 5
end
end
describe 'without a destination address' do
it "raises #{SocketSpecs.dest_addr_req_error}" do
-> { @client.send('hello', 0) }.should raise_error(SocketSpecs.dest_addr_req_error)