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

Version Path
rhodes-2.0.0.beta11 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta10 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta9 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta8 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta7 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta6 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta4 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta3 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.5.5 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta2 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-2.0.0.beta1 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.5.4 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.5.3 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.5.2 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.5.1 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.5.0 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.4.2 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.4.1 spec/framework_spec/app/spec/core/process/fork_spec.rb
rhodes-1.4.0 spec/framework_spec/app/spec/core/process/fork_spec.rb