notes/devops/sandbox/serverspec/getting-started/spec/localhost/sample_spec.rb

38 lines
833 B
Ruby

require 'spec_helper'
describe package('apache'), if: os[:family] == 'arch' do
it { should be_installed }
end
describe service('httpd'), if: os[:family] == 'arch' do
it { should be_enabled }
it { should be_running }
end
describe package('httpd'), if: os[:family] == 'redhat' do
it { should be_installed }
end
describe package('apache2'), if: os[:family] == 'ubuntu' do
it { should be_installed }
end
describe service('httpd'), if: os[:family] == 'redhat' do
it { should be_enabled }
it { should be_running }
end
describe service('apache2'), if: os[:family] == 'ubuntu' do
it { should be_enabled }
it { should be_running }
end
describe service('org.apache.httpd'), if: os[:family] == 'darwin' do
it { should be_enabled }
it { should be_running }
end
describe port(80) do
it { should be_listening }
end