Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 21 additions & 9 deletions core/io/select_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,16 +149,28 @@
end
end

describe "IO.select when passed nil for timeout" do
it "sleeps forever and sets the thread status to 'sleep'" do
t = Thread.new do
IO.select(nil, nil, nil, nil)
describe "IO.select with infinite timeout" do
describe :io_select_infinite_timeout, shared: true do
it "sleeps forever and sets the thread status to 'sleep'" do
t = Thread.new do
IO.select(nil, nil, nil, @method)
end

Thread.pass while t.status && t.status != "sleep"
t.join unless t.status
t.status.should == "sleep"
t.kill
t.join
end
end

Thread.pass while t.status && t.status != "sleep"
t.join unless t.status
t.status.should == "sleep"
t.kill
t.join
describe "IO.select when passed nil for timeout" do
it_behaves_like :io_select_infinite_timeout, nil
end

ruby_version_is "4.0" do
describe "IO.select when passed Float::INFINITY for timeout" do
it_behaves_like :io_select_infinite_timeout, Float::INFINITY
end
end
end