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

Add negate! support for describe.one object #1442

Merged
merged 5 commits into from
Jan 30, 2017
Merged

Conversation

alexpop
Copy link
Contributor

@alexpop alexpop commented Jan 30, 2017

I also added unit tests for the other Inspec resources that were missing them.

@alexpop alexpop self-assigned this Jan 30, 2017
Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome improvement for the test coverage of the InSpec objects @alexpop

format("describe.one do\n %s\nend", all_tests)
if @negated
# We don't use the describe.one wrapper when negated because:
# !(test1 || test2) same as (!test1 && !test2) where && is implicit in inspec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation

@@ -67,7 +67,7 @@ def rb_describe
itsy = xtra.nil? ? 'it' : 'its(' + xtra.to_s.inspect + ')'
naughty = @negated ? '_not' : ''
xpect = defined?(@expectation) ? expectation.inspect : ''
if matcher == 'match'
if @expectation.class == Regexp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement, to cover regular expression handling for all kind of matchers

@chris-rock chris-rock merged commit a4d230e into master Jan 30, 2017
@chris-rock chris-rock deleted the ap/ortest-negate branch January 30, 2017 12:23
@arlimus arlimus added the Type: Enhancement Improves an existing feature label Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants