Skip to content

stack level too deep with engines #63

Closed
radar opened this Issue Feb 24, 2011 · 5 comments

2 participants

@radar
radar commented Feb 24, 2011

I'm trying to build an engine http://github.com/radar/forem/tree/broken using RSpec and it gives a "Stack level too deep" on an undefined method when I run bundle exec rspec spec/integration. This is because the forum_path method is undefined, but it also happens with any other undefined method.

The problem is that you get a stack trace like this:

.../gems/rspec-expectations-2.5.0/lib/rspec/matchers/method_missing.rb:9:in `method_missing'
.../gems/rails-5f1fc0c8ac6e/actionpack/lib/action_dispatch/testing/assertions/routing.rb:175:in `method_missing'
.../gems/rails-5f1fc0c8ac6e/actionpack/lib/action_dispatch/testing/integration.rb:378:in `method_missing'
.../gems/rspec-expectations-2.5.0/lib/rspec/matchers/method_missing.rb:9:in `method_missing'
..........

As you can see here, it's in an infinite loop, causing the stack level too deep error. I'm interested in any insight that can be offered on this.

@myronmarston
RSpec member

This was happening at one point and I fixed it:

44909b0

I'm surprised a similar thing is happening again. I'll try to take a look when I get a chance. To repro, should I just clone your repo, checkout the broken branch, bundle install and run bundle exec rspec spec/integration?

@radar
radar commented Feb 24, 2011

Thank you for the quick response Myron,

Yes, just clone, checkout, bundle and exec will get you to the same stage I'm at.

@myronmarston
RSpec member

I've found that if you comment out your include RSpec::Matchers line from your integration example group module, it fixes the problem.

There's a deeper problem here (including RSpec::Matchers should not have that effect), but I haven't been able to get to the root cause of it yet.

Let's keep this open for now as I continue to investigate it.

@radar
radar commented Feb 24, 2011

Oh neat! Thanks Myron, and good luck finding the root cause.

@myronmarston
RSpec member

Prevent SystemStackError on 1.9 when users include RSpec::Matchers in an example group.

Closed by 80e5300.

@kchien kchien pushed a commit to kchien/rspec-expectations that referenced this issue Mar 7, 2014
@myronmarston myronmarston Prevent SystemStackError on 1.9 when users include RSpec::Matchers in…
… an example group.

Closes #63.
80e5300
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.