AutoTest / Rspec - "stack level too deep"

Hello,

I’m running AutoTest with Rspec on a Rails application.

Every 20 or so runs I get “stack level too deep” on one particular
controller stub.

Ex.

controller.stub!(:login).and_return(true)

This particular line is in a before block of a certain describe block.
The
strange thing is, every single spec in this file fails on that one line,
even the specs in other describe blocks!

Just for the hell of it, I commented it out. Then it fails on another
controller stub in another describe block. Same behavior, every spec
fails
on this one line.

I continue commenting the lines that are causing problems. I noticed it
only
happens with controller stubs and mocks. Once I finally get all
controller
mocks and stubs commented out, then my spec fails for legitimate reasons
(because of the missing stubs).

The only way I can fix this, is to reset AutoTest.

Any ideas?

Thanks,

Matt

P.S. If you really need to see this 750 line spec file, I’d be glad to
pastie it, but I don’t think it’ll reveal anything.

On 5/12/2007, at 9:43 AM, Matthew L. wrote:

Hello,

I’m running AutoTest with Rspec on a Rails application.

Every 20 or so runs I get “stack level too deep” on one particular
controller stub.

So this spec fails when you just run it?? I was a little unsure if
you are having a problem with autotest or with your spec … it
seemed the later?

Cheers
Shane

On 12/4/07 2:53 PM, “Shane M.” removed_email_a[email protected] wrote:

So this spec fails when you just run it?? I was a little unsure if
you are having a problem with autotest or with your spec … it
seemed the later?

No I think its a combination of Autotest and Rspec.

Let me summarize:

  • I have Autotest running constantly with Rspec on a Rails app

  • When I start Autotest it’ll run all my tests, ALL PASS

  • After making changes to code, Autotest detects such and runs the tests
    again for the specific file I’m editing ( a controller in this case)

  • After about 10-20 changes(Autotest runs the specs each time), I get a
    bunch of errors (“stack level too deep”) on my controller mocks and
    stubs.

The only way I can cure this, is by restarting AutoTest. Then in 10-20
more
changes it’ll happen again.

It’s very frustrating.

If anyone can even give me a clue, I’d be very grateful.

Let me know if I can provide any more information, sorry if I’m doing a
poor
job of explaining the problem.

Thanks,

Matt

On Dec 5, 2007, at 10:37 AM, Matthew L. wrote:

Let me summarize:
get a

Let me know if I can provide any more information, sorry if I’m
doing a poor
job of explaining the problem.

Thanks,

Matt

It would probably be helpful to see the stack trace.

Scott

Pasting more of your code would help. I get this error when infinite
recursion creeps into the application, or in my specs… like when you
run .save! on a model that has an after_filter calling save!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs