Author: Sven Schwyn (www.bitcetera.com)
Issues and forum: forge.bitcetera.com/projects/show/autotest-fsevent
Autotest relies on filesystem polling to detect modifications in source code files. In other words: The filesytem is constantly being traversed which causes quite some load on both the CPU and the harddrive. This is not healthy for your Mac and if you are working on a portable computer, it will drain your battery. Apple has introduces FSEvent with Mac OS X 10.5 which is a very efficient way to have the operating system monitor file alterations. This gem teaches autotest to use FSEvent and therefore be nice to your Mac.
Unlike other test runners for the Mac, autotest-mac does not replace but extend autotest and does not require RubyCocoa to be installed.
If you are on Linux, you should take a look at the autotest-inotify gem instead:
Mac OS X >= 10.5
any ZenTest compatible test suite
In order to compile the fsevent binary at install time, Xcode (Mac OS X Development Suite) must be installed. You can download it for free from:
Furthermore, you have to decide whether you want to use the comprehensive ZenTest gem or the lightweight autotest-standalone gem and install either of them. (See “Autotest” below for more on this.)
gem install ZenTest --OR-- gem install autotest-standalone
Now install the gem:
gem install autotest-fsevent
Then add the following line *after all other requires* in your ~/.autotest file:
If you like this gem, please consider to recommend me on Working with Rails, thank you!
You can use any ZenTest-compatible test suite with this gem, which basically boils down to either of the following two sets of gems.
Comprehensive test suite by Ryan Davis:
autotest-rails (for Ruby on Rails compatibility)
Lightweight test suite by Michael Grosser:
autotest-rails-pure (for Ruby on Rails compatibility)
zentest-without-autotest (for full ZenTest compatibility)
Note: Due to a naming disagreement, starting from version 4.4.6 the autotest gem is no longer a lightweight fork but only an empty gem which requires ZenTest. Switch to the autotest-standalone gem if you want to stick with the lightweight approach.
Make sure you have either the ZenTest gem or the autotest-standalone gem installed. This dependency has been dropped as of autotest-fsevent-0.2.3 in order to allow any compatible test suite.
Make sure you have Xcode (Mac OS X Development Suite) installed. You can download it for free from:
If you don't want to install Xcode, download and use a prebuilt fsevent_sleep from github.com/svoop/autotest-fsevent/tree/master/prebuilt, make the downloaded binary executable and install the gem as follows:
FSEVENT_SLEEP="/absolute/path/to/fsevent_sleep" gem install autotest-fsevent
You can install the bleeding edge version as follows:
git clone git://github.com/svoop/autotest-fsevent.git cd autotest-fsevent bundle install rake build rake install
Please submit issues on:
To contribute code, fork the project on Github, add your code and submit a pull request:
Thanks to the following folks who have contributed to this project:
(The MIT License)
Copyright © 2010 Sven Schwyn
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.