Sha256: 59a3302fa57212a0f7c9b284aa30217502582ef4f153b1ae46106b3a9f3710f4

Contents?: true

Size: 688 Bytes

Versions: 1

Compression:

Stored size: 688 Bytes

Contents

require 'spec_helper'
require 'process_exists'

describe Process do
  it 'responds to :exists?' do
    expect(subject).to respond_to(:exists?)
  end

  describe '.exists?' do
    it 'returns false when a pid does not exist' do
      expect(subject.exists?(-2)).to be false
    end

    it 'returns true when a pid exists' do
      expect(subject.exists?(Process.pid)).to be true
    end

    it 'returns true when a pid exists and belongs to another user' do
      # Process ID 1 is usually the init process primarily responsible for starting and shutting down the system.
      expect(subject.exists?(1)).to be true
    end unless running_specs_as_root?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
process_exists-0.2.0 spec/process_spec.rb