-
Notifications
You must be signed in to change notification settings - Fork 681
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
Conversation
Signed-off-by: Alex Pop <[email protected]>
Signed-off-by: Alex Pop <[email protected]>
Signed-off-by: Alex Pop <[email protected]>
Signed-off-by: Alex Pop <[email protected]>
Signed-off-by: Alex Pop <[email protected]>
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
I also added unit tests for the other Inspec resources that were missing them.