Improve logic that finds the failure line to print.
Created by: myronmarston
- Introduce
project_source_dirs
config setting. - Look for the first backtrace line in one of the
project_source_dirs
rather than the first line from your spec file. This helps in situations where you define a helper method in a support file that has a failing expectation, and call it from your spec. Previously it would have shown the helper method call site rather than the expectation in the helper method itself. - If no backtrace line can be found in a
project_source_dirs
, pick the first backtrace line. While we don’t generally want to show lines from gems, it’s better than showing no line at all.
Fixes #1991 (closed).