diff options
Diffstat (limited to 'test/fiber/test_process.rb')
-rw-r--r-- | test/fiber/test_process.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/fiber/test_process.rb b/test/fiber/test_process.rb index a5990be204..cc1694576e 100644 --- a/test/fiber/test_process.rb +++ b/test/fiber/test_process.rb @@ -34,6 +34,27 @@ class TestFiberProcess < Test::Unit::TestCase end.join end + def test_system_faulty_process_wait + Thread.new do + scheduler = Scheduler.new + + def scheduler.process_wait(pid, flags) + Fiber.blocking{Process.wait(pid, flags)} + + # Don't return `Process::Status` instance. + return false + end + + Fiber.set_scheduler scheduler + + Fiber.schedule do + assert_raise TypeError do + system("true") + end + end + end.join + end + def test_fork omit 'fork not supported' unless Process.respond_to?(:fork) Thread.new do |