Sha256: fa3ea9cda1c729fafbbbdf75d37bb99d1bbd0c1a4539cbbf872e62fa954c4277
Contents?: true
Size: 852 Bytes
Versions: 19
Compression:
Stored size: 852 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' describe "Process.fork" do not_supported_on :jruby, :windows do before :each do @file = tmp('i_exist') File.delete(@file) if File.exist?(@file) end after :each do File.delete(@file) if File.exist?(@file) end it "return nil for the child process" do child_id = Process.fork if child_id == nil File.open(@file,'w'){|f| f.write 'rubinius'} Process.exit! else Process.waitpid(child_id) end File.exist?(@file).should == true end it "runs a block in a child process" do pid = Process.fork { File.open(@file,'w'){|f| f.write 'rubinius'} Process.exit! } Process.waitpid(pid) File.exist?(@file).should == true end end end
Version data entries
19 entries across 19 versions & 1 rubygems