Am trying to achieve condition that if the group exists in the server it should pass & if not exists it should skip and should not show as failure
describe.one do
describe 'testgroup' do
expect(bash("ipa group-show testgroup").exit_status).to eq 0
it { should exist }
end
describe 'testgroup' do
expect(bash("ipa group-show testgroup").exit_status).to_not eq 0
it { should_not exist }
end
end
After executing using:
# inspec exec testgroup_test.rb
It throws error output as:
undefined method 'bash' for Rspec::ExampleGroups (No method Error).
Please advice, how to achieve such condition testing in inspec.