Topic: Rspec and Autotest Issue

I've installed the latest ZenTest gem and the latest rspec and rspec-rails plugin for a site that I'm working on.  I can effectively run the specs individually, but when I try to start up autotest, it stalls out after the first line: loading autotest/rails.  After this, I don't see the full load path like normal and nothing else happens.  It just hangs.  Is anyone else experiencing this?

Last edited by elliotlarson (2008-06-24 13:17:20)

Re: Rspec and Autotest Issue

I spent some time scrounging around in the Rspec Lighthouse issue tracker and found a solution that works.  If I type the following instead of just "autotest" things go as planned:

prompt$ RSPEC=true autotest

Hope this saves someone else some time.

Re: Rspec and Autotest Issue

That did save me some time.  Thanks!

Re: Rspec and Autotest Issue

I also faced the same issue on rspec and rspec-rails 1.2.2.  After following this post's advice, it started working. 

However, I upgraded to rspec and rspec-rails 1.2.4 and got the "hanging" issue again.  I downgraded to 1.2.2, but the issue remains. 

I saw an article that 1.2.4 breaks cucumber, but why would it cause the ZenTest issue even after downgrading? 

Thanks!


Reference: https://rspec.lighthouseapp.com/project … -rspec-124

Re: Rspec and Autotest Issue

Isn't 'autospec' the command to use with newer versions (>1.1.5) of rspec?

Rob Anderton
TheWebFellas

Re: Rspec and Autotest Issue

Yes people should use autospec instead.

Re: Rspec and Autotest Issue

I have tried autospec too.  I get the same message as autotest and then it hangs. 

loading autotest/rails_rspec

Are there any PATH or other variables I should have?

Re: Rspec and Autotest Issue

Let's leave autospec for a minute. What happens if you just run: $ spec spec/models/your_model_spec.rb ?

Re: Rspec and Autotest Issue

$ spec spec/models/myresource_spec.rb

The program 'spec' is currently not installed.  You can install it by typing:
sudo apt-get install librspec-ruby1.8


I'm not sure why (if this is a necessary library) it was not installed with rspec-1.2.2.  After installing that lib, I tried again.

$ spec spec/models/myresource_spec.rb 
/usr/lib/ruby/gems/1.8/gems/rspec-1.2.2/lib/spec/autorun.rb:3: undefined method `autorun' for Spec::Runner:Module (NoMethodError)
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:155:in `require'
    from /home/matthew/dev/source/tdd/spec/spec_helper.rb:5
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from ./spec/models/myresource_spec.rb:1
    from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `load'
    from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:14:in `load_files'
    from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:13:in `each'
    from /usr/lib/ruby/1.8/spec/runner/example_group_runner.rb:13:in `load_files'
    from /usr/lib/ruby/1.8/spec/runner/options.rb:85:in `run_examples'
    from /usr/lib/ruby/1.8/spec/runner/command_line.rb:19:in `run'
    from /usr/bin/spec:4

Last edited by ozymandias (2009-04-16 08:09:58)

Re: Rspec and Autotest Issue

Your installation is flawed. Did you install rspec and/or rubygems using debian's package?

Re: Rspec and Autotest Issue

I didn't, but I uninstalled and re-installed both rspec and rspec-rails to be sure (now both are version 1.2.4).  However, I still get the same error. 

Is there anything that I should untar instead of using rubygems?  Perhaps rubygems itself is installed incorrectly?

Re: Rspec and Autotest Issue

which spec

What does it return?

Re: Rspec and Autotest Issue

usr/bin/spec

I installed with sudo.

Re: Rspec and Autotest Issue

I uninstalled and reinstalled all gems and ruby itself.  That seems to have fixed the problem. 

However, I'm having trouble with cucumber now wink  I'll post that separately. 

Thank you for all of your help, Johnson.

Re: Rspec and Autotest Issue

I am experiencing a similar thing where autospec will not run. I have the rspec and rspec-rails gems installed, version 1.2.4. And the ZenTest gem, version 4.0.0. They are not installed as a plugin. When I run autospec it displays the loading message and then hangs.

$autospec
loading autotest/rails_rspec

It runs the tests if I run
rake spec

and it also runs the tests if I run
spec spec/models/your_model_spec.rb

It works as expected if I run autotest. and
$ which spec 
/usr/local/bin/spec

Any suggestions?

Last edited by dalboy (2009-04-27 18:44:14)

Re: Rspec and Autotest Issue

I just installed rspec and rspec-rails as gems and I am having the same issue.  When I run the autospec command I get "loading autotest/rails_rspec" and then hangs.