February 2018
Intermediate to advanced
406 pages
9h 52m
English
Another way to get test feedback quickly is to allow the tests to run automatically when your code changes. In Ruby, the Guard gem allows you to trigger arbitrary events when files change.[81] It’s a powerful system, and running tests is only a fraction of what it can do. You’re just going to manage basic setup here; full documentation is available online. Mac users should check out the Mac-specific wiki page to make sure Guard receives file events correctly.[82]
Guard is a generic system for triggering events, and it has separate libraries that make it easy to trigger specific kinds of events, such as starting a test.
To set up Guard, add the Guard gem and any of the dependent libraries to the Gemfile. ...