Rspec is giving an error with my layout links from the rails tutorial: “Failure/Error: Unable to find matching line from backtrace”

独自空忆成欢 提交于 2019-12-23 04:32:29

问题


Same question, but solution did not work:, I've tried several versions of rspec: Why is Rspec saying "Failure/Error: Unable to find matching line from backtrace"?

dpalacio:sample_app dpalacio$ rspec -v
2.0.0.beta.18
dpalacio:sample_app dpalacio$ rspec spec/
controllers/    factories.rb    models/         requests/       spec_helper.rb  
dpalacio:sample_app dpalacio$ rspec spec/requests/
FFFFF

Finished in 0.55501 seconds
5 examples, 5 failures

1) LayoutLinks should have a Home page at '/'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

2) LayoutLinks should have a Contact page at '/contact'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

3) LayoutLinks should have an About page at '/about'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

4) LayoutLinks should have a Help page at '/help'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

5) LayoutLinks should have a Help page at '/signup'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

And the same with the 2.0.1 version:

dpalacio:sample_app dpalacio$ rspec -v
2.0.1
dpalacio:sample_app dpalacio$ rspec spec/
controllers/    factories.rb    models/         requests/       spec_helper.rb  
dpalacio:sample_app dpalacio$ rspec spec/requests/
FFFFF

Finished in 0.55501 seconds
5 examples, 5 failures

1) LayoutLinks should have a Home page at '/'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

2) LayoutLinks should have a Contact page at '/contact'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

3) LayoutLinks should have an About page at '/about'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

4) LayoutLinks should have a Help page at '/help'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

5) LayoutLinks should have a Help page at '/signup'
    Failure/Error: Unable to find matching line from backtrace
    stack level too deep
    # /Users/dpalacio/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/forwardable.rb:185

回答1:


Ok found the issue, the issue is not RSPEC but WEBRAT. Add to your Gemfile:

gem 'webrat', '0.7.1'

The version of RSPEC should be: gem 'rspec', '2.0.1'




回答2:


It's hard to see this as a (purely) webrat issue ...

group :test, :development do
gem 'rspec-rails', '2.0.0.beta.18'
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'cucumber'
gem 'spork'
gem 'launchy'
end

... since I'm using capybara instead of webrat.

Any ideas are welcome.




回答3:


This doesn't seem to be an issue as of rspec 2.2.0



来源:https://stackoverflow.com/questions/3981852/rspec-is-giving-an-error-with-my-layout-links-from-the-rails-tutorial-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!