I enjoy creating small automations using Ruby and Bash. While it might
be simpler to use Bash, I like #Ruby so much that I want to use it more.
Here are two examples of how to run all the tests that have changed in
the current branch: an example for Minitest and one for RSpec
How to run all tests from the current branch using Minitest
How to run all tests from the current branch using RSpec
You can, of course, modify this script to become an MCP, enabling tools like Claude Code or Cursor to run tests at the end of an implementation.
During multiple rounds of test runs and fixes, when focusing on each test individually LLMs may pass the most recent test they fixed but fail previous ones.