File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -706,13 +706,15 @@ def child_pids(pid)
706
706
end
707
707
708
708
it "maps the key to a file descriptor in the child that inherits the file descriptor from the parent specified by the value" do
709
- child_fd = find_unused_fd
710
- args = ruby_cmd ( fixture ( __FILE__ , "map_fd.rb" ) , args : [ child_fd . to_s ] )
711
- pid = Process . spawn ( *args , { child_fd => @io } )
712
- Process . waitpid pid
713
- @io . rewind
714
-
715
- @io . read . should == "writing to fd: #{ child_fd } "
709
+ File . open ( __FILE__ , "r" ) do |f |
710
+ child_fd = f . fileno
711
+ args = ruby_cmd ( fixture ( __FILE__ , "map_fd.rb" ) , args : [ child_fd . to_s ] )
712
+ pid = Process . spawn ( *args , { child_fd => @io } )
713
+ Process . waitpid pid
714
+ @io . rewind
715
+
716
+ @io . read . should == "writing to fd: #{ child_fd } "
717
+ end
716
718
end
717
719
end
718
720
end
You can’t perform that action at this time.
0 commit comments