0
我正在开发一个Rails v2.3应用程序。Rspec错误,当我运行我的控制器的rspec测试
当运行RSpec的测试通过执行命令:
rspec spec/controllers/my_controller_spec.rb
我得到的错误消息这将在下面示出:
/.rvm/gems/[email protected]/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:427:in `raise_if_rspec_1_is_loaded': (RuntimeError)
********************************************************************************
You are running rspec-2, but it seems as though rspec-1 has been loaded as
well. This is likely due to a statement like this somewhere in the specs:
require 'spec'
Please locate that statement, remove it, and try again.
********************************************************************************
/.rvm/gems/[email protected]/gems/rspec-core-2.6.4/lib/rspec/core/configuration.rb:420:in `load_spec_files'
----更新---
由于它抱怨它包含的代码require 'spec'
一些文件,所以我遵循这个线索,我在规格/ spec_helper.rb,然而发现“require 'spec'
”,我删除它之后,同样的错误仍然提高up,而我现在没有任何其他文件包含代码。
为什么错误还在后面,那么究竟是什么原因呢?
config/test.rb和spec_helper文件是怎么查找的? –
@Alok,我在confi/test.rb中发现了“require'spec'”,在我删除它之后,同样的错误仍然出现,并且我没有任何其他文件包含代码 –