Autotest Mac

DESCRIPTION:

The autotest-mac gem contains a set of improvements for ZenTest’s autotest on Mac OS X. It’s absolutely useless on any other platform.

FEATURES:

FSEvent

ZenTest’s 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 in no time. 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.

Test/Scenario Results

With autotest-mac the terminal running autotest is cleared on every cycle. You can, however, scroll up and see the output of previous cycles. Furthermore, autotest-mac configures autotest to display test (RSpec and Test::Unit) and scenario (Cubumber) results as Growl notifications, decorated with a cute set of colored ruby icons.

Please note that autotest does not yet fully support Cucumber and therefore autotest-mac has to use a workaround which may cause issues if you are using custom :waiting hooks.

Exceptions

The following directories are added as exceptions by mac-autotest and thus won’t be monitored:

  • .git

  • .svn

  • .hg

  • .DS_Store

  • ._*

  • vendor

REQUIREMENTS:

  • Mac OS X >= 10.5 (for FSEvent instead of filesystem polling)

  • Growl

  • ZenTest >= 4.0.0

INSTALL:

First install the gem:

sudo gem install autotest-mac

Then add the following line to the top of your ~/.autotest file:

require 'autotest-mac'

Make sure Growl is installed on your computer. You can download it from growl.info

The growlnotify utility (located inside the Extras folder) must be installed as well.

A glitch in Growl 1.1.4 on Mac OS X 10.5 randomly prevents some notifications from being displayed. A workaround is built into autotest-mac, however, you have to perform some additional steps to make it work:

Open “System Preferences -> Growl -> Network“ and set the checkboxes ”Listen for incoming notifications“ and ”Allow remote application registration”. Once the first notification has been displayed, you can unset the latter checkbox again.

LICENSE:

(The MIT License)

Copyright © 2009 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.