Autotest rspec issues

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.

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.

  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.

  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.

I’d love to hear any suggestions you may have and thank you kindly in
advance.

Brad

On Nov 20, 2007, at 12:23 PM, Brad C. 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?

  1. 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).

  1. 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/
foo/template.rhtml_spec.rb

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).

Scott

On Nov 20, 2007, at 12:23 PM, Brad C. 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.

Oops. Didn’t read your info very well ;).

You’ll want to upgrade to the latest Zentest - 3.6.1. That should
fix you right up.

Scott

On Nov 20, 2007, at 6:36 PM, Brad C. wrote:

Oops. Didn’t read your info very well ;).

You’ll want to upgrade to the latest Zentest - 3.6.1. That should
fix you right up.

You were absolutely right. My gem configuration is kind of mangled
(Leopard thing) and ZenTest would only update to 3.5.0 so I thought it
was the most recent version.

Strange. Are you using the rubygems which comes with leopard? I
wonder if it’s a bug…

Scott

Scott T. wrote:

On Nov 20, 2007, at 12:23 PM, Brad C. 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.

Oops. Didn’t read your info very well ;).

You’ll want to upgrade to the latest Zentest - 3.6.1. That should
fix you right up.

You were absolutely right. My gem configuration is kind of mangled
(Leopard thing) and ZenTest would only update to 3.5.0 so I thought it
was the most recent version.

Manually downloading and installing the gem fixed every one of the
issues for me, using some instructions from one of David’s posts (but
for ZenTest 3.6.1):
http://blog.davidchelimsky.net/articles/2007/05/01/rspec-0-9-1-and-autotest-zentest-3-5-2

At that point I had two versions of ZenTest installed and did a
targetted uninstall of 3.5.0.

Many thanks, Scott. I could’ve saved hours of frustration had I only
come here first!

Brad

Scott T. wrote:

You were absolutely right. My gem configuration is kind of mangled
(Leopard thing) and ZenTest would only update to 3.5.0 so I thought it
was the most recent version.

Strange. Are you using the rubygems which comes with leopard? I
wonder if it’s a bug…

I am. First thing I did at the terminal was a ‘gem update --system’
which, as it now turns out, is a no-no, since the gem directories get
mixed up. I’ve recently since explicitly set the GEM_PATH and GEM_HOME
to point to the Leopard defaults to avoid further confusion. Some gems
were being written to /usr/lib/ruby/gems/1.8

More details here:
http://www.luisdelarosa.com/2007/11/10/ruby-bugs-on-leopard/

In any case, rspec and zentest are working wonderfully now. Thanks
again.

Brad