# Autotest broken on winxp?

**URL:** <https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842>\
**Category:** Ruby\
**Created:** [December 9, 2006, 2:16am UTC](https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842 "2006-12-09T02:16:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [December 9, 2006, 2:16am UTC](https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842/1 "2006-12-09T02:16:40Z")

</div>

I haven’t tried autotest on windows for a long time, but I thought it  
worked back then. Now, I get this error:

C:\dev\row\>autotest  
c:/program  
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294:in  
`expand_path': couldn't find HOME environment -- expanding`~/.autotest’ (ArgumentError)  
from c:/program  
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294  
from c:/program  
files/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`require' from c:/program files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/rails_autotest.rb:1 from c:/program files/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`require’  
from c:/program  
files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/bin/autotest:44  
from c:/Program Files/ruby/bin/autotest:18

I think I remember having to hand-fix some code originally, but again  
it was a long time ago (maybe 6 months ago).

I also tried “autotest -rails” at the top folder of one of my rails  
projects, but I got the same error.

Any idea what I’m doing wrong? Or is this a known issue with autotest  
perhaps?

I have zentest 3.4.2 (did a gem update zentest to make sure), and I’m  
on WinXP SP2.

Thanks!  
Jeff

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [December 9, 2006, 2:22am UTC](https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842/2 "2006-12-09T02:22:43Z")

</div>

On Dec 8, 2006, at 17:14 , Jeff wrote:

> I haven’t tried autotest on windows for a long time, but I thought it  
> worked back then. Now, I get this error:
> 
> C:\dev\row\>autotest  
> c:/program  
> files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294:in  
> `expand_path': couldn't find HOME environment -- expanding `~/.autotest’ (ArgumentError)

Well, windows doesn’t expand ~.

> I think I remember having to hand-fix some code originally, but again  
> it was a long time ago (maybe 6 months ago).
> 
> I also tried “autotest -rails” at the top folder of one of my rails  
> projects, but I got the same error.
> 
> Any idea what I’m doing wrong?

You haven’t filed a bug so we can track and fix it.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)

I LIT YOUR GEM ON FIRE!

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [December 9, 2006, 3:35pm UTC](https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842/3 "2006-12-09T15:35:26Z")

</div>

Eric H. wrote:

> You haven’t filed a bug so we can track and fix it.

I know, I just thought I’d ask the community if there’s something I  
should investigate first, before I bother you with a ticket… I’ll go  
ahead and file a bug for it.

Thanks!  
Jeff

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [December 9, 2006, 5:57pm UTC](https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842/4 "2006-12-09T17:57:41Z")

</div>

Jeff wrote:

> I haven’t tried autotest on windows for a long time, but I thought it  
> worked back then. Now, I get this error:
> 
> C:\dev\row\>autotest  
> c:/program  
> files/ruby/lib/ruby/gems/1.8/gems/ZenTest-3.4.2/lib/autotest.rb:294:in  
> `expand_path': couldn't find HOME environment -- expanding`~/.autotest’ (ArgumentError)  
> from c:/program

Do you have the HOME environment variable set?

From ri File.expand\_path:

The given pathname may start with a `+~+'', which expands to the process owner's home directory (the environment variable +HOME+ must be set correctly).`+~+_user_’’ expands to the named user’s home  
directory.

This is arguably a bug in File.expand\_path rather than ZenTest. (On  
Windows systems, a fallback to ENV[‘HOME’] should be ENV[‘HOMEDRIVE’] +  
ENV[‘HOMEPATH’]. Wonder where you report those.

David V.

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [December 10, 2006, 4:27pm UTC](https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842/5 "2006-12-10T16:27:21Z")

</div>

Daniel B. wrote:

> > > ```
> > > from c:/program
> > > 
> > > ```
> > 
> > Windows systems, a fallback to ENV[‘HOME’] should be ENV[‘HOMEDRIVE’] +  
> > ENV[‘HOMEPATH’]. Wonder where you report those.
> 
> This has been discussed before. See [http://tinyurl.com/y52hs3](http://tinyurl.com/y52hs3), among  
> others.

Erght, I forgot about %USERPROFILE%. Well, that leaves the whole thing  
rather fuzzy. So, bug in autotest for relying on File.expand\_path with a  
tilde, or Ruby for letting people rely on it? Or the usual, let’s blame  
Microsoft _ducks_.

David V.

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [December 9, 2006, 6:33pm UTC](https://www.ruby-forum.com/t/autotest-broken-on-winxp/78842/6 "2006-12-09T18:33:46Z")

</div>

David V. wrote:

> ENV[‘HOMEPATH’]. Wonder where you report those.  
> This has been discussed before. See [http://tinyurl.com/y52hs3](http://tinyurl.com/y52hs3), among  
> others.

The fundamental issue is that “~” is a shell thing, not an OS thing. To  
me, the bug is that File.expand\_path accepts ‘~’ at all. But, things  
are what they are. Come to think of it, I could add support for this in  
win32-file. 🙂

In practice I never use ‘~’. I mostly use ENV[‘HOME’] ||  
ENV[‘USERPROFILE’].

Regards,

Dan
