|
259 | 259 | ruby_version_is "3.1" do
|
260 | 260 | describe "rb_io_maybe_wait_writable" do
|
261 | 261 | it "returns mask for events if operation was interrupted" do
|
262 |
| - @o.rb_io_maybe_wait_writable(Errno::EINTR::Errno, @w_io, nil).should == 4 # IO::WRITABLE = 4 |
| 262 | + @o.rb_io_maybe_wait_writable(Errno::EINTR::Errno, @w_io, nil).should == IO::WRITABLE |
263 | 263 | end
|
264 | 264 |
|
265 | 265 | it "returns 0 if there is no error condition" do
|
|
330 | 330 | ruby_version_is "3.1" do
|
331 | 331 | describe "rb_io_maybe_wait_readable" do
|
332 | 332 | it "returns mask for events if operation was interrupted" do
|
333 |
| - @o.rb_io_maybe_wait_readable(Errno::EINTR::Errno, @r_io, nil, false).should == 1 # IO::READABLE = 1 |
| 333 | + @o.rb_io_maybe_wait_readable(Errno::EINTR::Errno, @r_io, nil, false).should == IO::READABLE |
334 | 334 | end
|
335 | 335 |
|
336 | 336 | it "returns 0 if there is no error condition" do
|
|
344 | 344 | @w_io.write "rb_io_wait_readable"
|
345 | 345 | end
|
346 | 346 |
|
347 |
| - @o.rb_io_maybe_wait_readable(Errno::EAGAIN::Errno, @r_io, 1, true).should == 1 # IO::READABLE = 1 |
| 347 | + @o.rb_io_maybe_wait_readable(Errno::EAGAIN::Errno, @r_io, IO::READABLE, true).should == IO::READABLE |
348 | 348 | @o.instance_variable_get(:@read_data).should == "rb_io_wait_re"
|
349 | 349 |
|
350 | 350 | thr.join
|
|
412 | 412 |
|
413 | 413 | Thread.pass until start
|
414 | 414 |
|
415 |
| - @o.rb_io_maybe_wait(Errno::EAGAIN::Errno, @r_io, 1, nil).should == 1 # IO::READABLE = 1 |
| 415 | + @o.rb_io_maybe_wait(Errno::EAGAIN::Errno, @r_io, IO::READABLE, nil).should == IO::READABLE |
416 | 416 |
|
417 | 417 | thr.join
|
418 | 418 | end
|
419 | 419 |
|
420 | 420 | it "returns mask for events if operation was interrupted" do
|
421 |
| - @o.rb_io_maybe_wait(Errno::EINTR::Errno, @w_io, 4, nil).should == 4 # IO::WRITABLE = 4 |
| 421 | + @o.rb_io_maybe_wait(Errno::EINTR::Errno, @w_io, IO::WRITABLE, nil).should == IO::WRITABLE |
422 | 422 | end
|
423 | 423 |
|
424 | 424 | it "returns false if there is no error condition" do
|
425 |
| - @o.rb_io_maybe_wait(0, @w_io, 4, nil).should == false # IO::WRITABLE = 4 |
| 425 | + @o.rb_io_maybe_wait(0, @w_io, IO::WRITABLE, nil).should == false |
426 | 426 | end
|
427 | 427 |
|
428 | 428 | it "raises an IOError if the IO is closed" do
|
429 | 429 | @w_io.close
|
430 |
| - -> { @o.rb_io_maybe_wait(0, @w_io, 4, nil) }.should raise_error(IOError, "closed stream") # IO::WRITABLE = 4 |
| 430 | + -> { @o.rb_io_maybe_wait(0, @w_io, IO::WRITABLE, nil) }.should raise_error(IOError, "closed stream") |
431 | 431 | end
|
432 | 432 |
|
433 | 433 | it "raises an IOError if the IO is not initialized" do
|
434 |
| - -> { @o.rb_io_maybe_wait(0, IO.allocate, 4, nil) }.should raise_error(IOError, "uninitialized stream") # IO::WRITABLE = 4 |
| 434 | + -> { @o.rb_io_maybe_wait(0, IO.allocate, IO::WRITABLE, nil) }.should raise_error(IOError, "uninitialized stream") |
435 | 435 | end
|
436 | 436 | end
|
437 | 437 | end
|
|
0 commit comments