Skip to content

Commit 53d0cf4

Browse files
committed
Use exit 0 instead of true on windows platform
1 parent c8355a8 commit 53d0cf4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/fiber/test_process.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
require_relative 'scheduler'
44

55
class TestFiberProcess < Test::Unit::TestCase
6+
TRUE_CMD = RUBY_PLATFORM =~ /mswin|mingw/ ? "exit 0" : "true"
7+
68
def test_process_wait
79
Thread.new do
810
scheduler = Scheduler.new
911
Fiber.set_scheduler scheduler
1012

1113
Fiber.schedule do
12-
pid = Process.spawn("true")
14+
pid = Process.spawn(TRUE_CMD)
1315
Process.wait(pid)
1416

1517
# TODO test that scheduler was invoked.
@@ -25,7 +27,7 @@ def test_system
2527
Fiber.set_scheduler scheduler
2628

2729
Fiber.schedule do
28-
system("true")
30+
system(TRUE_CMD)
2931

3032
# TODO test that scheduler was invoked (currently it's not).
3133

@@ -49,7 +51,7 @@ def scheduler.process_wait(pid, flags)
4951

5052
Fiber.schedule do
5153
assert_raise TypeError do
52-
system("true")
54+
system(TRUE_CMD)
5355
end
5456
end
5557
end.join

0 commit comments

Comments
 (0)