-
-
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
Failure results make it impossible to figure out what diverged from the expected string #420
Comments
I've experienced the same frustration using aruba in Cucumber-Ruby's own test suite. The solution, for me, is to use the word 'exactly' in your step, i.e. |
@kurko I tried to make output more reable by using the
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective. |
This has been partly handled in #546. For negated matchers, the problem persists. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs. |
Bump. |
Summary
Aruba/Cucumber output is cryptic. It's basically impossible to find out what is different between the expected string and the output string when there's a test failure.
Expected Behavior
I would expect to have something like RSpec provides, like:
or, because my output has so many
\n
, make a diff between all of them by splitting lines:Current Behavior
The problem is seen in this Pull Request: https://github.com/zipmark/rspec_api_documentation/pull/313/files#diff-0b3146a61839789912f87a2e19beaaa4R244. The library is responsible for generating documentation files. We write an expectation and then make sure the file matches what was generated.
However, when there's one character off, this is the output I get:
Here's an actual print screen:
Possible Solution
I tried to dig into Aruba's source code but I'm not very familiar with how even Cucumber works. Its documentation is somewhat cryptic to me (described as steps). I see that there's something called
@announce
, but that didn't do anything for me (and I failed to find documentation that I could use).RSpec has that functionality to compare strings built-in. Would it be possible to should pipe that output into RSpec's matches?
I could try to help with that but I'd need directions because the documentation is unclear to me.
Steps to Reproduce (for bugs)
git clone https://github.com/zipmark/rspec_api_documentation.git
git checkout 235-blueprint-api
bundle install
features/api_blueprint_documentation.feature
, around lines 260.bundle exec cucumber features
You will see my screenshot, basically.
Context & Motivation
I'm working on a lib that generates documentation automatically based on RSpec tests. The fixture has over 200 lines, so when even one character changes, it's virtually impossible to find out why it's failing, or in other words, what string is different from the expectation.
This is making my work very slow. I have to either look by eye or copy paste somewhere else to figure out the diff.
Your Environment
Thanks a lot.
The text was updated successfully, but these errors were encountered: