我正在做一些测试,每次运行它们时都会收到以下警告:
DEPRECATION WARNING: you are using a deprecated constant that will
be removed from a future version of RSpec.
C:/Sites/injixo/spec/views/me_home_spec.rb:1in 'require'
*Rspec is deprecated
*Rspec is the new top-level module in RSpec-2我安装了最新版本的RSpec 2.6.1,所以我不确定为什么会出现这个警告。有没有人能解释一下这件事,以及我该如何删除它。
谢谢JP
发布于 2012-01-13 05:30:38
问题最有可能出现在spec/spec_helper.rb中,这可能是您的规范所要求的。对于您的问题,您必须手动键入一些错误消息,而不是复制并粘贴它。顶级模块现在称为RSpec,并带有大写的S。您的spec_helper应该如下所示:
# spec/spec_helper.rb
RSpec.configure do |config|
...
end发布于 2012-10-09 21:58:46
我在使用guard时遇到了这个错误。我只是简单的改变
guard 'rspec', :version => 2 do至
guard 'rspec' do在Guardfile中。
https://stackoverflow.com/questions/8806861
复制相似问题