1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/spec/ruby/library/io-wait/wait_readable_spec.rb
2022-09-28 18:37:17 +02:00

25 lines
542 B
Ruby

require_relative '../../spec_helper'
require 'io/wait'
describe "IO#wait_readable" do
before :each do
@io = File.new(__FILE__ )
end
after :each do
@io.close
end
it "waits for the IO to become readable with no timeout" do
@io.wait_readable.should == @io
end
it "waits for the IO to become readable with the given timeout" do
@io.wait_readable(1).should == @io
end
it "waits for the IO to become readable with the given large timeout" do
@io.wait_readable(365 * 24 * 60 * 60).should == @io
end
end