-
Notifications
You must be signed in to change notification settings - Fork 69
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
Show line number of failed scenario #172
Comments
It would be even better to do as |
@cirosantilli @aackerman You can easily create your own reporter to show the required info. For example, I recently created a reporter that writes failing scenarios in a txt file to rerun them later: https://github.com/arandaio/spinach-rerun-reporter 😉 |
hack for that (append to env) module Spinach
class Reporter
# This module handles Stdout's reporter error reporting capabilities.
module Reporting
def summarized_error(error)
feature, scenario, step, exception = error
summary = " #{feature.name} :: #{scenario.name} :: #{full_step step} (#{feature.instance_variable_get('@filename')}:#{scenario.line})"
if exception.kind_of?(Spinach::StepNotDefinedException)
summary.red
elsif exception.kind_of?(Spinach::StepPendingException)
summary += "\n Reason: '#{exception.reason}'\n"
summary.yellow
else
summary.red
end
end
end
end
end |
We found that the approach shown above no longer works with spinach 0.10.1. Support for "scenario.line" has been removed and replaced with "scenario.lines". Unfortunately, this spits out all the line numbers, not just the one for the failing test. A way to get the old behavior back would be appreciated. |
It would be cool to see it at least on the Errors summary, something like:
so I can easily run just the failing test next with
spinach test.spinach:123
The text was updated successfully, but these errors were encountered: