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
10 changes: 10 additions & 0 deletions core/io/select_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@
-> { IO.select(nil, nil, nil, -5)}.should raise_error(ArgumentError)
end

ruby_version_is "4.0" do
it "raises an ArgumentError when passed negative infinity as timeout" do
-> { IO.select(nil, nil, nil, -Float::INFINITY)}.should raise_error(ArgumentError)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the exception messages are meaningful it seems worth specifying it them here.
It'll also convenient when implementing those semantics, vs having to check what message CRuby uses.

end
end

it "raises an RangeError when passed NaN as timeout" do
-> { IO.select(nil, nil, nil, Float::NAN)}.should raise_error(RangeError)
end

describe "returns the available descriptors when the file descriptor" do
it "is in both read and error arrays" do
@wr.write("foobar")
Expand Down