-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
add rspec-run-last-failed to rerun only failed examples #122
Conversation
I have not tested it yet, but I think this is an awesome feature 👍 |
@@ -668,6 +676,10 @@ or a cons (FILE . LINE), to run one example." | |||
(message "No spec files found!") | |||
(rspec-compile (rspec-runner-target spec-files) opts))) | |||
|
|||
(defvar rspec-last-failed-specs | |||
'() |
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.
'()
is the same as nil, and no need to put it on a separate line.
rspec-run-last-failed will re-run the specs that failed during the last invocation. By default this is bound to C-c ,f.
Changes:
Thanks for the comments! |
(failure-regexp "^rspec \\([0-9A-Za-z@_./:-]+\\.rb:[0-9]+\\)") | ||
(failures (save-match-data | ||
(let ((pos 0) matches) | ||
(while (string-match failure-regexp body pos) |
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.
This would be better performed with re-search-forward
. You don't copy the buffer text into a string; instead use save-excursion
, (goto-char (point-min))
, and traverse the buffer till the end while saving the matches,
Thanks for the comment. I've updated the logic, hopefully correctly. |
Dropped the |
Squash-merged. Thanks! |
👍 Thanks! |
rspec-run-last-failed will re-run the specs that failed during the last invocation. By default this is bound to
C-c ,f
.I'm not an elisp pro so I'm sure there's some cleanup that can be done here. Feedback welcome!