-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Improve failure messages from output matchers #546
Conversation
Aruba depends on rspec-expectations >= 3.4, so these version checks will always pass.
The include_an_object matcher is not part of Aruba's public API so should not be described in the feature files.
This is a replacement for the feature file which was removed.
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.
Having read this, it makes sense to make the change.
Extracting MessageIndenter, removing old details, and improving compatibility with RSpec Matcher usage, all incremental improvements.
When I run `cucumber` | ||
Then the features should not all pass with: | ||
""" | ||
expected `aruba-test-cli` to have output string includes: "goodbye world" |
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.
Narrator: I was missing something.
Perhaps I am missing something, but line 61 and line 56 have mismatched wording.
expected `aruba-test-cli` to have output string includes: "goodbye world"
"to have output string including" would be my personal expectation (just reading the line)
Then the features should all pass | ||
Then the features should not all pass with: | ||
""" | ||
expected `aruba-test-cli` to have output output string is eq: "hello\nworld" |
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.
...but now I understand there's more to it, we're surfacing RSpec matchers more directly in these messages.
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.
Please disregard my first comment.
if RSpec::Expectations::Version::STRING >= '3.1' | ||
RSpec::Matchers.define_negated_matcher :have_failed_running, :be_successfully_executed | ||
end | ||
RSpec::Matchers.define_negated_matcher :have_failed_running, :be_successfully_executed |
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 cleanup.
Right. I still think this is an improvement, but it didn't improve the case for negative failures of |
Summary
Make the message from the output matchers/steps provide enough information to figure out what went wrong.
Details
have_output
matcher failure message print the command name and the full actual output.include_an_object
matcher not print boiler plate when the collection has exactly one member.include_an_object
since it is non-public API.Motivation and Context
The build failures for #544 do not provide enough information to see what failed because the actual output is truncated to a single-line string.
How Has This Been Tested?
Features and specs were added.
Types of changes
Checklist: