File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 55
55
end
56
56
end
57
57
58
- it "returns supplied objects correctly even when monitoring the same object in different arrays" do
59
- filename = tmp ( "IO_select_pipe_file" ) + $$ . to_s
58
+ it "returns supplied objects correctly when monitoring the same object in different arrays" do
59
+ filename = tmp ( "IO_select_pipe_file" )
60
60
io = File . open ( filename , 'w+' )
61
61
result = IO . select [ io ] , [ io ] , nil , 0
62
62
result . should == [ [ io ] , [ io ] , [ ] ]
63
63
io . close
64
64
rm_r filename
65
65
end
66
66
67
+ it "returns the pipe read end in read set if the pipe write end is closed concurrently" do
68
+ main = Thread . current
69
+ t = Thread . new {
70
+ Thread . pass until main . stop?
71
+ @wr . close
72
+ }
73
+ IO . select ( [ @rd ] ) . should == [ [ @rd ] , [ ] , [ ] ]
74
+ ensure
75
+ t . join
76
+ end
77
+
67
78
it "invokes to_io on supplied objects that are not IO and returns the supplied objects" do
68
79
# make some data available
69
80
@wr . write ( "foobar" )
You can’t perform that action at this time.
0 commit comments