How to run autotest(Zentest)


When I start the “autotest” it gives me the following error…not sure
HOME path I have to set…all Ruby/Rails related components are in path!

C:>autotest -rails
expand_path': couldn't find HOME environment -- expanding ~/.autotest’

Any clues? Thanks.

View this message in context:
Sent from the RubyOnRails Users forum at

Hey Nara - It needs to build a path to your tests, so you need run it
from the root of your rails application.


On Windows, the HOME environment variable is not set.


SET HOME=“C:\Documents And Settings<Your User Name Here>”

or add the HOME variable via system settings and run autotest again.


Thanks Max,

I have set the HOME to the rails app root directory…it works fine with
windows root :slight_smile:


Max M.-3 wrote:

Rails mailing list
[email protected]

View this message in context:
Sent from the RubyOnRails Users forum at

This can be helpful to future users

Rails autotest installation is not same in Windows and Linux. If we do
it in the same way then we will get the error “couldn’t find HOME
environment – expanding ‘~/.autotest’”.
The reason for the error is Autotest looks for a .autotest file in the
path defined by the HOME environment variable. Whis is set in Linux but
not on windows. We don’t necessarily
have to have a .autotest file, but we will need to set the HOME
environment variable.

Therefore, here is the installation instructions for the developers
using windows to work with autotest:

  1. Install ZenTest
    – gem install zentest
  2. Install diff-lcs
    – gem install zentest diff-lcs
  3. Install RSpec Autotest

Without subversion – ruby script/plugin install
With subversion – ruby script/plugin install -x

  1. In Linux after these steps “rake spec:autotest” will work fine. But
    we need to do something more for windows environment.

    • Download and install diffutils, " Complete package, except sources
      — Setup —24 May 2004 " from
      DiffUtils for Windows
    • Put the installation directory of diff.exe into your PATH in
      Control Panel → System → Advanced → Environment Variables.
  2. Go to the application directory of current rails application then set
    the home variable:

    – set home=.

  3. Go to the current rails application directory and run
    – autotest

Only if required ------

If rake spec:autotest don’t work go through the following steps:

  1. For ZenTest 3.5.0++
    cd spec
    svn export
    c a l d e r s p h e r e . n e t
    cd …

  2. Add the following in the Rake file.

namespace :spec do
task :autotest do
require ‘./spec/rspec_autotest’

Or if you really want a Rake task for the job, add this to the Rakefile:

namespace :spec do
task :autotest do
system ‘autotest’

  1. Start working with rake spec:autotest or autotest.