# How to run autotest(Zentest)

**URL:** <https://www.ruby-forum.com/t/how-to-run-autotest-zentest/65079>\
**Category:** Rails\
**Created:** [August 16, 2006, 12:10am UTC](https://www.ruby-forum.com/t/how-to-run-autotest-zentest/65079 "2006-08-16T00:10:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hariraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/4491bb/32.png) [@hariraj](https://www.ruby-forum.com/u/hariraj)\
**Post date:** [August 16, 2006, 12:10am UTC](https://www.ruby-forum.com/t/how-to-run-autotest-zentest/65079/1 "2006-08-16T00:10:00Z")

</div>

Hi,

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

* * *

## C:\>autotest -rails C:/Tools/InstantRails/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.3.0/lib/autotest.rb:285:in `expand_path': couldn't find HOME environment -- expanding `~/.autotest’ (ArgumentError)

## Any clues? Thanks. Hari

View this message in context:  
[http://www.nabble.com/How-to-run-autotest(Zentest)-tf2111845.html#a5822990](http://www.nabble.com/How-to-run-autotest%28Zentest%29-tf2111845.html#a5822990)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![hariraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/4491bb/32.png) [@hariraj](https://www.ruby-forum.com/u/hariraj)\
**Post date:** [August 16, 2006, 12:13am UTC](https://www.ruby-forum.com/t/how-to-run-autotest-zentest/65079/2 "2006-08-16T00:13:01Z")

</div>

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

cheers,  
Jodi

---

<div class="post-metadata">

**Author:** ![hariraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/4491bb/32.png) [@hariraj](https://www.ruby-forum.com/u/hariraj)\
**Post date:** [August 16, 2006, 12:16am UTC](https://www.ruby-forum.com/t/how-to-run-autotest-zentest/65079/3 "2006-08-16T00:16:01Z")

</div>

On Windows, the HOME environment variable is not set.

try

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

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

Max

---

<div class="post-metadata">

**Author:** ![hariraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/4491bb/32.png) [@hariraj](https://www.ruby-forum.com/u/hariraj)\
**Post date:** [August 16, 2006, 2:07am UTC](https://www.ruby-forum.com/t/how-to-run-autotest-zentest/65079/4 "2006-08-16T02:07:10Z")

</div>

Thanks Max,

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

\_Hari

Max M.-3 wrote:

> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

–  
View this message in context:  
[http://www.nabble.com/How-to-run-autotest(Zentest)-tf2111845.html#a5824326](http://www.nabble.com/How-to-run-autotest%28Zentest%29-tf2111845.html#a5824326)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![hariraj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/4491bb/32.png) [@hariraj](https://www.ruby-forum.com/u/hariraj)\
**Post date:** [February 29, 2008, 1:11pm UTC](https://www.ruby-forum.com/t/how-to-run-autotest-zentest/65079/5 "2008-02-29T13:11:54Z")

</div>

## 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  
[http://svn.caldersphere.net/svn/main/plugins/rspec\_autotest](http://svn.caldersphere.net/svn/main/plugins/rspec_autotest)  
With subversion – ruby script/plugin install -x  
[http://svn.caldersphere.net/svn/main/plugins/rspec\_autotest](http://svn.caldersphere.net/svn/main/plugins/rspec_autotest)

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

2. Go to the application directory of current rails application then set  
the home variable:

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](http://svn.caldersphere.net/svn/main/rspec_autotest/trunk/lib/rspec_autotest.rb)  
cd …

2. Add the following in the Rake file.

namespace :spec do  
task :autotest do  
require ‘./spec/rspec\_autotest’  
RspecAutotest.run  
end  
end

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

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

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

* * *
