Sha256: 80e169440418d64c4f0ec8c7e00543addcd7fadf71af794e85a900c939805c6a

Contents?: true

Size: 891 Bytes

Versions: 5

Compression:

Stored size: 891 Bytes

Contents

require 'spec_helper'

set :os, :family => 'base'

describe commands.command_class('process').create do
  it { should be_an_instance_of(Specinfra::Command::Base::Process) }
end

describe process("memcached") do
  let(:stdout) { " 1407\n" }
  its(:pid) { should eq 1407 }
end

describe process("memcached") do
  let(:stdout) { "/usr/bin/memcached -m 14386 -p 11211 -u nobody -l 10.11.1.53 -c 30000\n" }
  its(:args) { should match /-c 30000\b/ }
end

describe process("memcached") do
  let(:stdout) { "nobody\n" }
  its(:user)  { should eq "nobody" }
end

describe process("memcached") do
  let(:stdout) { "nobody\n" }
  its(:group)  { should eq "nobody" }
end

describe process("memcached") do
  context "when running" do
    let(:stdout) { " 1407\n" }
    it { should be_running }
  end

  context "when not running" do
    let(:stdout) { " 1407\n" }
    it { should be_running }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta13 spec/type/base/process_spec.rb
serverspec-2.0.0.beta12 spec/type/base/process_spec.rb
serverspec-2.0.0.beta11 spec/type/base/process_spec.rb
serverspec-2.0.0.beta10 spec/type/base/process_spec.rb
serverspec-2.0.0.beta9 spec/type/base/process_spec.rb