diff options
Diffstat (limited to 'spec/ruby/library/io-wait/wait_readable_spec.rb')
-rw-r--r-- | spec/ruby/library/io-wait/wait_readable_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/ruby/library/io-wait/wait_readable_spec.rb b/spec/ruby/library/io-wait/wait_readable_spec.rb new file mode 100644 index 0000000000..06ffbda5c8 --- /dev/null +++ b/spec/ruby/library/io-wait/wait_readable_spec.rb @@ -0,0 +1,27 @@ +require_relative '../../spec_helper' + +ruby_version_is ''...'3.2' do + require 'io/wait' +end + +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 |