File: pid_behavior.rb

package info (click to toggle)
ruby-childprocess 5.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: ruby: 1,285; makefile: 4
file content (12 lines) | stat: -rw-r--r-- 338 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
require File.expand_path('../spec_helper', __FILE__)

shared_examples_for "a platform that provides the child's pid" do
  it "knows the child's pid" do
    Tempfile.open("pid-spec") do |file|
      process = write_pid(file.path).start
      process.wait

      expect(process.pid).to eq rewind_and_read(file).chomp.to_i
    end
  end
end