Sha256: 08a27aef08463ae16be994e9a3892a42d93306c30bf2ce74202bbfa4e1b360e7

Contents?: true

Size: 1.88 KB

Versions: 6

Compression:

Stored size: 1.88 KB

Contents

require 'spec_helper'

include Specinfra::Helper::RedHat

=begin
describe service('sshd') do
  it { should be_enabled }
end

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

describe service('sshd') do
  it { should be_enabled.with_level(4) }
end

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

describe service('sshd') do
  it { should be_running }
end

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

describe service('sshd') do
  let(:stdout) { "sshd is stopped\r\n" }
  it { should be_running }
end

describe service('sshd') do
  it { should be_running.under('supervisor') }
end

describe service('invalid-daemon') do
  it { should_not be_running.under('supervisor') }
end

describe service('sshd') do
  it { should be_running.under('upstart') }
end

describe service('invalid-daemon') do
  it { should_not be_running.under('upstart') }
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') }
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


=end

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

=begin

describe service('unicorn') do
  it { should be_monitored_by('god') }
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

=end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta8 spec/type/service_spec.rb
serverspec-2.0.0.beta7 spec/type/service_spec.rb
serverspec-2.0.0.beta6 spec/type/service_spec.rb
serverspec-2.0.0.beta5 spec/type/service_spec.rb
serverspec-2.0.0.beta4 spec/type/service_spec.rb
serverspec-2.0.0.beta3 spec/type/service_spec.rb