Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document InSpec OR features #853

Closed
chris-rock opened this issue Aug 1, 2016 · 0 comments
Closed

Document InSpec OR features #853

chris-rock opened this issue Aug 1, 2016 · 0 comments
Labels
Aspect: Docs Write the Fine Manual
Milestone

Comments

@chris-rock
Copy link
Contributor

Description

Default Serverspec and RSpec do not support OR tests. InSpec added this feature:

describe.one do
  describe ssh_config do
    its('Protocol') { should eq('3') }
  end
  describe ssh_config do
    its('Protocol') { should eq('2') }
  end
end

That allows you to write a control and test for a or b

control 'or-test' do
  impact 1.0
  title 'This is a OR test'
  describe.one do
    describe ssh_config do
      its('Protocol') { should eq('3') }
    end
    describe ssh_config do
      its('Protocol') { should eq('2') }
    end
  end
end
@chris-rock chris-rock added the Aspect: Docs Write the Fine Manual label Aug 1, 2016
@chris-rock chris-rock added this to the 1.0.0 milestone Aug 1, 2016
@chris-rock chris-rock modified the milestones: 1.0.0, 0.32.0 Aug 19, 2016
@vjeffrey vjeffrey self-assigned this Aug 21, 2016
@arlimus arlimus closed this as completed Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aspect: Docs Write the Fine Manual
Projects
None yet
Development

No branches or pull requests

3 participants