Autospec Infinite Loop?

When I run autospec and I have a red example, autospec goes into an
infinite loop and runs over and over until I get rid of the red.

I hate this. I want my tests to just run once when my ruby file is
saved - even if I have red examples.

The infinite loop does not happen if my examples are all green, all
yellow or a mix of green and yellow.

I have tried ZenTest 3.11, Zentest 4.0, and autotest (http://
GitHub - grosser/autotest: Save a file, autotest will run the matching tests! (Autotest without ZenTest)).

Is there a way to make autospec run just once if it sees a red
example?

I am using rspec 1.2.2, platform: cygwin - testing a standalone ruby
class.

Thanks!!!

On Mon, Apr 6, 2009 at 4:50 PM, Arco [email protected] wrote:

GitHub - grosser/autotest: Save a file, autotest will run the matching tests! (Autotest without ZenTest)).

Is there a way to make autospec run just once if it sees a red
example?

I am using rspec 1.2.2, platform: cygwin - testing a standalone ruby
class.

What’s in your spec/spec.opts file?

David C. wrote:

On Mon, Apr 6, 2009 at 4:50 PM, Arco [email protected] wrote:

GitHub - grosser/autotest: Save a file, autotest will run the matching tests! (Autotest without ZenTest)).

Is there a way to make autospec run just once if it sees a red
example?

I am using rspec 1.2.2, platform: cygwin - testing a standalone ruby
class.

What’s in your spec/spec.opts file?

I get the same behavior…
my spec/spec.opts contains:
–colour
–format progress
–loadby mtime
–reverse

I can reproduce in a new project…

rails blog
cd blog/
script/generate rspec
script/generate rspec_scaffold posts title:string body:text
rm -rf test/
rake db:create:all
rake db:migrate
rake db:test:prepare
autospec

posts generated in plural to get error at beginning

the loop runs forever

Do you have any files, which might be changed during your failing
tests? Some temporary files or whatsoever? If that’s the case, then
autotest thinks that you have made some changes already and tries to
run again. Solution would be to put that file into ignore list for
autotest.

sorry my self reply… but I forgot to mention that I am running Ubuntu
8.10 ruby 1.8.7.xx

Jarmo P. wrote:

Do you have any files, which might be changed during your failing
tests? Some temporary files or whatsoever? If that’s the case, then
autotest thinks that you have made some changes already and tries to
run again. Solution would be to put that file into ignore list for
autotest.

No… all was working some days ago.
in fact the same issue occurs with a new fresh project. Here is my test

rails blogapp
cd blogapp
script/generate rspec
script/generate rspec_scaffold posts title:string body:text
rake db:migrate
autospec

This will cause error because posts is pluralized… so my autospec
loops forever.
all my applications are issuing the same behavior.

I am with latest rspec and rspec-rails gems (1.2.6 I mean)
when I back to my computer, I will provide a list of all my installed
gems.

On 12 jun 2009, at 13:42, Alexandre Da Silva wrote:

Jarmo P. wrote:

Do you have any files, which might be changed during your failing
tests? Some temporary files or whatsoever? If that’s the case, then
autotest thinks that you have made some changes already and tries to
run again. Solution would be to put that file into ignore list for
autotest.

No… all was working some days ago.

I have the same issue. Whether a red rspec or cucumber file, autotest
goes beserk.
Using the latest and greatest gems, on a fresh rails app.

gr,
bartz

Bart Z. wrote:

On 12 jun 2009, at 13:42, Alexandre Da Silva wrote:

Jarmo P. wrote:

Do you have any files, which might be changed during your failing
tests? Some temporary files or whatsoever? If that’s the case, then
autotest thinks that you have made some changes already and tries to
run again. Solution would be to put that file into ignore list for
autotest.

No… all was working some days ago.

I have the same issue. Whether a red rspec or cucumber file, autotest
goes beserk.
Using the latest and greatest gems, on a fresh rails app.

gr,
bartz

it seems that many people are getting the same,
at least for me and all developers from my two teams.

yesterday I realise that when I have green results, then I modify my
controller files, than rspec does not auto restart the tests.
does anyone else having the same behavior?

att,
Alexandre

On Fri, Jun 12, 2009 at 6:42 AM, Alexandre Da
Silva[email protected] wrote:

rails blogapp
cd blogapp
script/generate rspec
script/generate rspec_scaffold posts title:string body:text
rake db:migrate
autospec

I just copied this all into a shell and the specs ran only once and
stopped, as expected.

rspec-1.2.6
rspec-rails-1.2.6
ZenTest-4.1.1
Mac OS 10.5.7
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

Anything different in your environment?

Also, I tried this with and without some autotest exceptions set up in
my ~/.autotest file, and it worked correctly in either case.

Same for me.

Maurício Linhares
http://codeshooter.wordpress.com/ | http://twitter.com/mauriciojr

On Jun 13, 2009, at 11:19 PM, Alexandre Da Silva wrote:

I just copied this all into a shell and the specs ran only once and
Also, I tried this with and without some autotest exceptions set up

Source one: remarkable gem
if you use remarkable, try do uninstall that gem and test if the
testes
continue looping

Source two: localized_dates plugin
if you use this plugin try removing it and run the tests again. I mean
that localized_dates plugin is not needed in rails 2.3.3 anymore.

I don’t have these plugins or gems, but I found out that downgrading
ZenTest to version 4.0.0 solved the problem.

HTH,
bartz

David C. wrote:

On Fri, Jun 12, 2009 at 6:42 AM, Alexandre Da
Silva[email protected] wrote:

rails blogapp
cd blogapp
script/generate rspec
script/generate rspec_scaffold posts title:string body:text
rake db:migrate
autospec

I just copied this all into a shell and the specs ran only once and
stopped, as expected.

rspec-1.2.6
rspec-rails-1.2.6
ZenTest-4.1.1
Mac OS 10.5.7
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]

Anything different in your environment?

Also, I tried this with and without some autotest exceptions set up in
my ~/.autotest file, and it worked correctly in either case.

gems are the same… but I have a lot of other gems. I tested removing
all gems and reinstaling one by one… after all gems installed (except
remarkable gem) the test above ran as expected.

After some inspects I found in different projects two possible sources
of the problem.

Source one: remarkable gem
if you use remarkable, try do uninstall that gem and test if the testes
continue looping

Source two: localized_dates plugin
if you use this plugin try removing it and run the tests again. I mean
that localized_dates plugin is not needed in rails 2.3.3 anymore.

On Mon, Jun 15, 2009 at 7:18 AM, Bart Z.[email protected]
wrote:

script/generate rspec
Mac OS 10.5.7

I don’t have these plugins or gems, but I found out that downgrading ZenTest
to version 4.0.0 solved the problem.

Did you install the autotest-rails gem per the ZenTest 4.1 release
notes?

David C. wrote:

On Mon, Jun 15, 2009 at 7:18 AM, Bart Z.[email protected]
wrote:

script/generate rspec
Mac OS 10.5.7

I don’t have these plugins or gems, but I found out that downgrading ZenTest
to version 4.0.0 solved the problem.

Did you install the autotest-rails gem per the ZenTest 4.1 release
notes?

Same issue here…

Installed autotest-rails gem and everything is working fine now.

Thanks.

Carlos.

OK - top posting here so everyone on this thread will see this:

If you upgrade to ZenTest 4.1, you must install the autotest-rails gem
or you will get unexpected results.

http://blog.davidchelimsky.net/2009/06/08/upgrading-to-zentest-410/

Cheers,
David

On Jun 15, 2009, at 2:36 PM, David C. wrote:

rails blogapp
rspec-rails-1.2.6
gems are the same… but I have a lot of other gems. I tested
if you use remarkable, try do uninstall that gem and test if the
to version 4.0.0 solved the problem.

Did you install the autotest-rails gem per the ZenTest 4.1 release
notes?

Of course not :).
I just ran sudo gem update :).
Will check, and report back though.

gr,
bartz