You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 30, 2024. It is now read-only.
I'm not sure why no one has suggested this yet, but it would be nice if there were a way to do this. This comes in handy especially when you are running a file that has, say, 100 examples and 20 of them fail and you don't want to waste time re-running the other 80. Additionally, whatever is keeping track of failed examples should do so across multiple files that you may be running. So if I am running the full spec suite and some of them fail and they are in separate files, I want the ability to re-run just those.
So the way it'd work is that rspec would write the failed examples to a (non-anonymous) file (this could be a YAML file where the key is a filename and value is an array of line numbers). Given this file contains failed examples, if I then ran rspec --failed, RSpec should read the file and run only those examples, and if any succeed it removes them from the YAML file. If there are no examples left in the YAML file, then rspec --failed runs everything. So obviously running rspec with the option never overwrites the YAML file, but without the option rspec should always overwrite it, that way if you were to run it with the option right afterward you'd get a fresh file.