Sha256: a758cbf6423472cc10ae3604af6a600c5d011bab945c4d9ed60d7901ceff782a

Contents?: true

Size: 1.52 KB

Versions: 6

Compression:

Stored size: 1.52 KB

Contents

require 'spec_helper'

RSpec.configure do |c|
  c.os = 'Debian'
end

describe service('sshd') do
  it { should be_enabled }
  its(:command) { should eq "test -x /etc/rc.d/init.d/sshd" }
end

describe service('invalid-service') do
  it { should_not be_enabled }
end

describe service('sshd') do
  it { should be_enabled.with_level(4) }
  its(:command) { should eq "test -x /etc/rc.d/init.d/sshd" }
end

describe service('invalid-service') do
  it { should_not be_enabled.with_level(4) }
end

describe service('sshd') do
  it {
    expect {
      should be_running.under('not implemented')
    }.to raise_error(ArgumentError, %r/\A`be_running` matcher doesn\'t support/)
  }
end

describe service('sshd') do
  let(:stdout) { "Process 'sshd'\r\n  status running\r\n  monitoring status  monitored" }
  it { should be_monitored_by('monit') }
  its(:command) { should eq "monit status" }
end

describe service('sshd') do
  let(:stdout) { "Process 'sshd'\r\n  status  not monitored\r\n  monitoring status  not monitored" }
  it { should_not be_monitored_by('monit') }
end

describe service('invalid-daemon') do
  it { should_not be_monitored_by('monit') }
end

describe service('unicorn') do
  it { should be_monitored_by('god') }
  its(:command) { should eq "god status unicorn" }
end

describe service('invalid-daemon') do
  it { should_not be_monitored_by('god') }
end

describe service('sshd') do
  it {
    expect {
      should be_monitored_by('not implemented')
    }.to raise_error(ArgumentError, %r/\A`be_monitored_by` matcher doesn\'t support/)
  }
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serverspec-0.10.7 spec/plamo/service_spec.rb.plamo
serverspec-0.10.6 spec/plamo/service_spec.rb.plamo
serverspec-0.10.5 spec/plamo/service_spec.rb.plamo
serverspec-0.10.4 spec/plamo/service_spec.rb.plamo
serverspec-0.10.3 spec/plamo/service_spec.rb.plamo
serverspec-0.10.2 spec/plamo/service_spec.rb.plamo