A Place for my head

On Ruby, Rails, Concurrency and fiction

Posted in : rails, ruby | 1 comment

Stuff floating on intrawebs for adding more files to be ignored using “add_exception” may not work because by the time “run” hook gets a chance to run, files to be ignored regexp is already compiled. The alternative is to use “initialize” hook like this:

1
2
3
Autotest.add_hook :initialize do |at|
  at.add_exception(/^(coverage|\.git)/)
end

This is with 3.11.0 of ZenTest and YMMV.

One Response to 'Autotest and add_exception method'

Subscribe to comments with RSS or TrackBack to 'Autotest and add_exception method'.

  1. Thanks for posting this! I just started using AutoTest and this saved me some time.

    Linux users might need to put:
    > at.add_exception(/^\.\/(coverage|\.git)/)

    since AutoTest is using Find and gets files/dirs as:
    > ./coverage
    > ./coverage/some_file
    > ./.git
    > ./.git/somefile

    I decided to be more strict and only include files from certain directories and exclude everything else. I used:
    > at.find_directories = ['./test']

    Diego A.

    12 Feb 09 at 8:53 pm

Leave a Reply