File tree Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Expand file tree Collapse file tree 1 file changed +14
-15
lines changed Original file line number Diff line number Diff line change 259
259
end
260
260
CODE
261
261
262
- # rubocop:disable Security/Open
263
- other_process = open ( "|ruby -e #{ Shellwords . escape ( test_script ) } 2>/dev/null" )
264
- # rubocop:enable Security/Open
262
+ IO . popen ( "ruby -e #{ Shellwords . escape ( test_script ) } 2>/dev/null" ) do |other_process |
265
263
266
- SimpleCov ::ResultMerger . synchronize_resultset do
267
- # wait until the child process is going, and then wait some more
268
- # so we can be sure it blocks on the lock we already have.
269
- sleep 0.1 until other_process . gets == "running\n "
270
- sleep 1
271
-
272
- # despite the sleeps, this will be written first since we got
273
- # the first lock
274
- File . open ( file . path , "a" ) { |f | f . write ( "process 1\n " ) }
275
- end
264
+ SimpleCov ::ResultMerger . synchronize_resultset do
265
+ # wait until the child process is going, and then wait some more
266
+ # so we can be sure it blocks on the lock we already have.
267
+ sleep 0.1 until other_process . gets == "running\n "
268
+ sleep 1
276
269
277
- # wait for it to finish
278
- other_process . gets
270
+ # despite the sleeps, this will be written first since we got
271
+ # the first lock
272
+ File . open ( file . path , "a" ) { |f | f . write ( "process 1\n " ) }
273
+ end
274
+
275
+ # wait for it to finish
276
+ other_process . gets
277
+ end
279
278
280
279
expect ( file . read ) . to eq ( "process 1\n process 2\n " )
281
280
end
You can’t perform that action at this time.
0 commit comments