2 ms·
Rails dev. This runs the most recently modified test in your spec/ directory: bin/rspec $(find spec -type f -exec stat -f '%a %N' {} \; | sort -r | head -1
by revscat 5y ago
Rails dev. This runs the most recently modified test in your spec/ directory:
bin/rspec $(find spec -type f -exec stat -f '%a %N' {} \; | sort -r | head -1 | awk '{print $NF}')
So if you are working on a spec & save it, running this will execute that spec & only that spec. I have it hooked up to a mapping in neovim, so hitting `<leader>rt` runs the test.
Needs some tweaking, and I'm aware that guard exists. This is simpler. Quick & does the job.