Sha256: d74ea2284fc22c3e3d9cd84a7958cfe4eb467c993390b79f1f0c90c01d688e44
Contents?: true
Size: 1.8 KB
Versions: 37
Compression:
Stored size: 1.8 KB
Contents
shared_examples_for 'support service enabled matcher' do |valid_service| describe 'be_enabled' do describe service(valid_service) do it { should be_enabled } end describe service('invalid-service') do it { should_not be_enabled } end end end shared_examples_for 'support service running matcher' do |valid_service| describe 'be_running' do describe service(valid_service) do it { should be_running } end describe service('invalid-daemon') do it { should_not be_running } end describe service(valid_service) do before :all do RSpec.configure do |c| c.stdout = "#{valid_service} is stopped\r\n" end end it { should be_running } end end end shared_examples_for 'support service running under supervisor matcher' do |valid_service| describe 'be_running.under("supervisor")' do describe service(valid_service) do before :all do RSpec.configure do |c| c.stdout = "#{valid_service} RUNNING\r\n" end end it { should be_running.under('supervisor') } end describe service(valid_service) do before :all do RSpec.configure do |c| c.stdout = "#{valid_service} STOPPED\r\n" end end it { should_not be_running.under('supervisor') } end describe service('invalid-daemon') do it { should_not be_running.under('supervisor') } end end end shared_examples_for 'support service running under unimplemented matcher' do |valid_service| describe 'be_running.under("not implemented")' do describe service(valid_service) do it { expect { should be_running.under('not implemented') }.to raise_error(ArgumentError, %r/\A`be_running` matcher doesn\'t support/) } end end end
Version data entries
37 entries across 37 versions & 1 rubygems