Open cirosantilli opened 9 years ago
It would be even better to do as cucumber
as rspec
and output the exact command to re-run a failing test to allow for simple copy/paste.
@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 :wink:
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