Skip to content

Commit

Permalink
Add a spec for TCPServer#accept
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Jun 16, 2013
1 parent 64bdb8f commit bcb64f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/ruby/library/socket/tcpserver/accept_spec.rb
Expand Up @@ -58,4 +58,16 @@
t.raise ex
lambda { t.join }.should raise_error(Exception)
end

ruby_version_is "1.9" do
it "returns a binary-mode socket" do
socket = TCPSocket.new('127.0.0.1', SocketSpecs.port)
socket.close
client = @server.accept
client.binmode?.should be_true
client.external_encoding.should == Encoding::BINARY
client.internal_encoding.should == nil
client.close
end
end
end

0 comments on commit bcb64f1

Please sign in to comment.