File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ def program
1717 end
1818
1919 def test_daemon
20- # The program can't be debugged locally since the parent process exits when Process.daemon is called.
2120 debug_code program , remote : :remote_only do
2221 type 'b 3'
2322 type 'c'
@@ -28,5 +27,26 @@ def test_daemon
2827 type 'c'
2928 end
3029 end
30+
31+ def program_with_daemon_arguments
32+ <<~'RUBY'
33+ 1| trap(:HUP, 'IGNORE')
34+ 2| puts 'Daemon starting'
35+ 3| Process.daemon(false, false)
36+ 4| puts 'Daemon started'
37+ RUBY
38+ end
39+
40+ def test_daemon_patch
41+ debug_code program_with_daemon_arguments , remote : :remote_only do
42+ type 'b 3'
43+ type 'c'
44+ assert_line_num 3
45+ type 'b 4'
46+ type 'c'
47+ assert_line_num 4
48+ type 'c'
49+ end
50+ end
3151 end
3252end
You can’t perform that action at this time.
0 commit comments