Retest is the ultimate CLI tool for Ruby developers, designed to make your testing workflow seamless and efficient. It monitors file changes and automatically runs relevant tests, ensuring that your code remains solid as you refactor and develop.
With zero setup required, Retest works right out of the box on any Ruby project—no changes to your Gemfile, no unnecessary repo clutter, and no configuration headaches. It's lightweight, dev-centric, and ready to integrate into your workflow instantly.
- Plug-and-Play: Start testing immediately—no installation hassles or setup scripts.
- Project Independence: Works with any Ruby project, no Gemfile modifications required.
- Time-Saving Automation: Automatically identifies and runs relevant tests as you code.
- Customizable Workflows: Tailor commands to your needs with placeholders, options, and interactive features.
- Sound Notifications: Get audible feedback for test results.
Discover Retest main functionalities in this small presentation
retest-v2-demo-converted.mp4
Testing frequently is the cornerstone of safe refactoring. Retest eliminates the friction of manual test execution by running tests after every file change, helping you stay just one cmd + z
away from green tests.
Install Retest globally in seconds:
gem install retest
No need to add it to your Gemfile—just install and go!
Run tests with your preferred commands, placeholders, or patterns:
retest 'bin/rails test <test> && rubocop <changed>' # Flexible placeholders
retest --all # Run all tests on every file change
retest --diff origin/main # Test changes from a branch
Stay in control with an interactive shell for test management. Start Retest and enter h
to explore available commands.
Setup identified: [RAKE]. Using command: 'bundle exec rake test TEST=<test>'
Watcher: [WATCHEXEC]
Launching Retest...
Ready to refactor! You can make file changes now
Type interactive command and press enter. Enter 'h' for help.
> h
* 'h', 'help' # Prints help.
* 'p', 'pause' # Pauses Retest. Tests aren't run on file change events until unpaused.
* 'u', 'unpause' # Unpauses Retest.
* <ENTER> # Runs last changed triggered command.
* 'ra, 'run all' # Runs all tests.
* 'f', 'force' # Forces a selection of test to run on every file change.
* 'r', 'reset' # Disables forced selection.
* 'd', 'diff' [GIT BRANCH] # Runs matching specs that changed from a target branch.
* 'c' # Clears window.
* 'e', 'exit' # Exits Retest.
Retest ships with Listen for file monitoring but can use the more performant Watchexec if installed.
To force a specific watcher:
retest -w watchexec
Retest can run inside Docker containers, ensuring your testing workflow stays consistent across environments.
# Inside your container shell
gem install retest
retest 'bundle exec rails test <test>'
Got feedback or ideas? Join the discussion for Retest 2.0 and share your thoughts:
Discussion - Retest V2.0 - Interactive Panel
Bug reports and pull requests are welcome at GitHub.
Want to contribute to Retest? Follow these steps to set up your environment
- Clone the repo and install dependencies:
bin/setup
- Run tests to ensure everything is working:
rake test
- Experiment with an interactive console:
bin/console
- To run integration tests (e.g., for a Hanami app):
bin/test/hanami-app
Retest is open-source and available under the MIT License.