Skip to content

Instantly share code, notes, and snippets.

@samaaron
Created July 27, 2009 19:51
Show Gist options
  • Select an option

  • Save samaaron/156699 to your computer and use it in GitHub Desktop.

Select an option

Save samaaron/156699 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'spec/autorun'
describe "binding sockets" do
it "should be possible to bind to a socket" do
s = UDPSocket.new
s.bind('localhost', 4422)
end
it "should be possible to bind to a socket again" do
s = UDPSocket.new
s.bind('localhost', 4422)
end
end
∴ /Users/sam/Desktop
λ ruby bind_spec.rb
.F
1)
Errno::EADDRINUSE in 'binding sockets should be possible to bind to a socket again'
Address already in use - bind(2)
bind_spec.rb:12:in `bind'
bind_spec.rb:12:
bind_spec.rb:4:
Finished in 0.004195 seconds
2 examples, 1 failure
∴ /Users/sam/Desktop
λ jruby bind_spec.rb
.F
1)
SocketError in 'binding sockets should be possible to bind to a socket again'
bind: name or service not known
bind_spec.rb:12:
:1
Finished in 0.058 seconds
2 examples, 1 failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment