Sha256: 54789b2e44868795671a1fd106db96dbf5bc9034a95106cbc9266440e4ab3404

Contents?: true

Size: 1003 Bytes

Versions: 93

Compression:

Stored size: 1003 Bytes

Contents

#! /usr/bin/env ruby

require 'spec_helper'

describe "ps facts" do

  it "should return busybox style ps www on OpenWrt" do
    Facter.fact(:operatingsystem).stubs(:value).returns 'OpenWrt'
    Facter.fact(:ps).value.should == 'ps www'
  end

  [
    'FreeBSD',
    'NetBSD',
    'OpenBSD',
    'Darwin',
    'DragonFly'
  ].each do |os|
    it "should return unix style ps on operatingsystem #{os}" do
      Facter.fact(:operatingsystem).stubs(:value).returns os
      Facter.fact(:ps).value.should == 'ps auxwww'
    end
  end

  # Other Linux Distros should return a ps -ef
  [
    'RedHat',
    'Debian',
  ].each do |os|
    it "should return gnu/linux style ps -ef on operatingsystem #{os}" do
      Facter.fact(:operatingsystem).stubs(:value).returns os
      Facter.fact(:ps).value.should == 'ps -ef'
    end
  end

  it "should return tasklist.exe on Windows" do
    Facter.fact(:operatingsystem).stubs(:value).returns 'windows'
    Facter.fact(:ps).value.should == 'tasklist.exe'
  end

end

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
facter-2.5.7 spec/unit/ps_spec.rb
facter-2.5.7-x86-mingw32 spec/unit/ps_spec.rb
facter-2.5.7-x64-mingw32 spec/unit/ps_spec.rb
facter-2.5.7-universal-darwin spec/unit/ps_spec.rb
facter-2.5.6-x86-mingw32 spec/unit/ps_spec.rb
facter-2.5.6-x64-mingw32 spec/unit/ps_spec.rb
facter-2.5.6-universal-darwin spec/unit/ps_spec.rb
facter-2.5.6 spec/unit/ps_spec.rb
facter-2.5.5-x86-mingw32 spec/unit/ps_spec.rb
facter-2.5.5-x64-mingw32 spec/unit/ps_spec.rb
facter-2.5.5-universal-darwin spec/unit/ps_spec.rb
facter-2.5.5 spec/unit/ps_spec.rb
facter-2.5.4-x86-mingw32 spec/unit/ps_spec.rb
facter-2.5.4-x64-mingw32 spec/unit/ps_spec.rb
facter-2.5.4-universal-darwin spec/unit/ps_spec.rb
facter-2.5.4 spec/unit/ps_spec.rb
facter-2.5.1 spec/unit/ps_spec.rb
facter-2.5.1-x86-mingw32 spec/unit/ps_spec.rb
facter-2.5.1-x64-mingw32 spec/unit/ps_spec.rb
facter-2.5.1-universal-darwin spec/unit/ps_spec.rb