File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 3
3
require_relative 'scheduler'
4
4
5
5
class TestFiberProcess < Test ::Unit ::TestCase
6
+ TRUE_CMD = RUBY_PLATFORM =~ /mswin|mingw/ ? "exit 0" : "true"
7
+
6
8
def test_process_wait
7
9
Thread . new do
8
10
scheduler = Scheduler . new
9
11
Fiber . set_scheduler scheduler
10
12
11
13
Fiber . schedule do
12
- pid = Process . spawn ( "true" )
14
+ pid = Process . spawn ( TRUE_CMD )
13
15
Process . wait ( pid )
14
16
15
17
# TODO test that scheduler was invoked.
@@ -25,7 +27,7 @@ def test_system
25
27
Fiber . set_scheduler scheduler
26
28
27
29
Fiber . schedule do
28
- system ( "true" )
30
+ system ( TRUE_CMD )
29
31
30
32
# TODO test that scheduler was invoked (currently it's not).
31
33
@@ -49,7 +51,7 @@ def scheduler.process_wait(pid, flags)
49
51
50
52
Fiber . schedule do
51
53
assert_raise TypeError do
52
- system ( "true" )
54
+ system ( TRUE_CMD )
53
55
end
54
56
end
55
57
end . join
You can’t perform that action at this time.
0 commit comments