File: test_spec.rb

package info (click to toggle)
ruby-process-executer 4.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 408 kB
  • sloc: ruby: 873; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 526 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

require 'English'

RSpec.describe 'Process#wait' do
  it 'sets the global $CHILD_STATUS variable' do
    pid = Process.spawn('ruby', '-e', 'exit 0')
    Process.wait(pid)
    expect($CHILD_STATUS).not_to be_nil
    expect($CHILD_STATUS.pid).to eq(pid)
  end
end

RSpec.describe 'Process#wait2' do
  it 'returns a non-nil status' do
    pid = Process.spawn('ruby', '-e', 'exit 0')
    _pid, status = Process.wait2(pid)
    expect(status).not_to be_nil
    expect(status.pid).to eq(pid)
  end
end