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

Fix contain / should match confusion #214

Merged
merged 1 commit into from
Nov 5, 2015
Merged

Conversation

zmalone
Copy link
Contributor

@zmalone zmalone commented Nov 4, 2015

If attempting to use "contain" here, you get

     [UNSUPPORTED] `contain` matcher. Please use the following syntax `its('content') { should match('value') }`.

it looks like this should say "should match". This may effect other resources, but I've only tried file.

If attempting to use "contain" here, you get 
         [UNSUPPORTED] `contain` matcher. Please use the following syntax `its('content') { should match('value') }`.

it looks like this should say "should match".  This may effect other resources, but I've only tried file.
@zmalone zmalone changed the title Fix should contain / should match confusion Fix contain / should match confusion Nov 4, 2015
@arlimus
Copy link
Contributor

arlimus commented Nov 5, 2015

Great catch, using match here is much better.

An alternative, by the way, is to use include which is not treated as a regular expression (unlike match).

describe file(...) do
  its('content') { should include 'hello...' }
end

Thank you @zmalone ! :)

arlimus added a commit that referenced this pull request Nov 5, 2015
Fix contain / should match confusion
@arlimus arlimus merged commit d675561 into inspec:master Nov 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants