Rspec 添加';时堆栈级别太深(SystemStackError);规格帮助器&x27;
我正在升级一个旧的Rspec 添加';时堆栈级别太深(SystemStackError);规格帮助器&x27;,rspec,ruby-on-rails-2,Rspec,Ruby On Rails 2,我正在升级一个旧的rails2.3应用程序,发现大多数规范都失败了。 我正在努力让他们通过 到目前为止,大多数规范文件还没有包含require“spec\u helper”,但需要添加它。 (不知道为什么它以前不在那里) 当我将spec\u helper添加到一些控制器时,我得到的错误堆栈级别太深(SystemStackError)。 我目前运行的程序如下,但我相信这可能是Rails 2.1的应用程序 轨道2.3.17 Rspec轨道1.3.2 Ruby 1.9.3 文件的顶部看起来像这样。
rails2.3应用程序
,发现大多数规范都失败了。
我正在努力让他们通过
到目前为止,大多数规范文件还没有包含require“spec\u helper”
,但需要添加它。
(不知道为什么它以前不在那里)
当我将spec\u helper
添加到一些控制器时,我得到的错误堆栈级别太深(SystemStackError)。
我目前运行的程序如下,但我相信这可能是Rails 2.1的应用程序
- 轨道2.3.17
- Rspec轨道1.3.2
- Ruby 1.9.3
require 'spec_helper'
require 'active_merchant'
include ActiveMerchant::Billing
describe 'AccountsController' do
...
这是我在做了一点修改后能够得到的堆栈跟踪
2)
stack level too deep
../bin/ruby_noexec_wrapper:14:in `<main>'
../gems/activesupport-2.3.17/lib/active_support/dependencies.rb:170:in `load_with_new_constant_marking'
../gems/ruby-1.9.3-p392@project/gems/rspec-1.3.2/lib/spec/runner/example_group_runner.rb:15:in `block in load_files'
../rspec-1.3.2/lib/spec/runner/example_group_runner.rb:14:in `each'
../gems/rspec-1.3.2/lib/spec/runner/example_group_runner.rb:14:in `load_files'
../gems/rspec-1.3.2/lib/spec/runner/options.rb:134:in `run_examples'
../gems/rspec-1.3.2/lib/spec/runner.rb:61:in `run'
../gems/rspec-1.3.2/lib/spec/runner.rb:45:in `block in autorun'
../gems/activesupport-2.3.17/lib/active_support/dependencies.rb:186: stack level too deep (SystemStackError)
2)
堆栈级别太深
../bin/ruby\u noexec\u包装器:14:in`'
../gems/activesupport-2.3.17/lib/active\u support/dependencies.rb:170:in'load\u with_new\u constant\u marking'
../gems/ruby-1.9.3-p392@project/gems/rspec-1.3.2/lib/spec/runner/example_group_runner.rb:15:in'block in load_files'
../rspec-1.3.2/lib/spec/runner/example\u group\u runner.rb:14:in'each'
../gems/rspec-1.3.2/lib/spec/runner/example\u group\u runner.rb:14:在“加载文件”中
../gems/rspec-1.3.2/lib/spec/runner/options.rb:134:in'run_examples'
../gems/rspec-1.3.2/lib/spec/runner.rb:61:in'run'
../gems/rspec-1.3.2/lib/spec/runner.rb:45:in'block in autorun'
../gems/activesupport-2.3.17/lib/active\u support/dependencies.rb:186:堆栈级别太深(SystemStackError)
从这里到哪里?尝试将
包含ActiveMerchant::Billing
移动到描述块中,如下所示:
require 'spec_helper'
require 'active_merchant'
describe 'AccountsController' do
include ActiveMerchant::Billing
...
参考资料:
- Dave Chelimsky的博客文章标题为