[rspec-users] Autotest rspec issues

Scott Taylor mailing_lists at railsnewbie.com
Tue Nov 20 12:35:03 EST 2007

On Nov 20, 2007, at 12:23 PM, Brad Carson wrote:

> I'm having trouble getting autotest to run "out of the box" with  
> rspec.
> I've got a Leopard setup with Zentest 3.5.0, rspec on trunk, and rails
> 2.0PR.  No ".autotest" file.

First off, I assume you have rspec 1.0.8, and ZenTest 3.6.1

> There are a couple of issues:
> 1. Running 'autotest' inititally yields a command not found for "spec
> --diff unified etc etc".   This seems to be an old issue but I can fix
> it by creating a "~/.autotest" file and attaching a hook to autotest
> initialize to explicity set the spec_command to script/spec.  Fine.

And you have diff-lcs gem installed, correct?  What version are you on?

If you run script/spec, is everything working just fine?

> 2. Regardless of #1, restarting autotest once loaded makes it crap out
> with an initialize error, complaining about wrong arguments (0 for  
> 1) or
> somesuch - the exact stack trace and error I can post when home again
> tonight.

You'll probably need to ./script/generate rspec.  (You should do this  
every time you get changes from rspec - I'm assuming your running off  
of rspec's trunk on externals in a rails project).

> 3. I can live with the first two, but autotest isn't picking up any
> changes to any view specs.  I've tried index.rhtml_spec.rb and
> index.html.erb_spec.rb but nothing does the trick.  Controller spec
> changes are detected just fine.  Haven't tried model specs yet.

Here's the relevant mapping:

       %r%^app/views/(.*)$% => proc { |_, m|
         files_matching %r%^spec/views/#{m[1]}_spec.rb$%

So if you have app/views/foo/template.rhtml, you'll want spec/views/ 

Let us know how it goes (I know technoweenie has been having problems  
with autotest as well - so maybe it's some sort of Leopard bug).


More information about the rspec-users mailing list