-
-
Notifications
You must be signed in to change notification settings - Fork 942
Implement Socket.socketpair to return Socket instances #4204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0587b2f
bd837cd
cb3a35d
2ffd857
303e5d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,21 @@ | ||
| describe :socket_socketpair, shared: true do | ||
| platform_is_not :windows do | ||
| it "ensures the returned sockets are connected" do | ||
| s1, s2 = Socket.socketpair(Socket::AF_UNIX, 1, 0) | ||
| s1, s2 = Socket.public_send(@method, Socket::AF_UNIX, 1, 0) | ||
| s1.puts("test") | ||
| s2.gets.should == "test\n" | ||
| s1.close | ||
| s2.close | ||
| end | ||
|
|
||
| it "responses with array of two sockets" do | ||
| s1, s2 = Socket.public_send(@method, :UNIX, :STREAM) | ||
|
|
||
| s1.should be_an_instance_of(Socket) | ||
| s2.should be_an_instance_of(Socket) | ||
| ensure | ||
| s1.close | ||
| s2.close | ||
| end | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's OK to add specs directly here, even if the commits contains other changes. The advantages is it's tested directly against jruby and we don't need to wait for a spec merge. |
||
| end | ||
| end | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The opened file descriptors should be closed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done