RSpec is deprecated

I am working on several tests, and every time I run them, I get the following warning:

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 

I have the latest version 2.6.1 of RSpec installed, so I don’t know why this warning appears. Can anyone shed some light on this question and how can I remove it.

Thanks in JP

+6
source share
2 answers

The problem is most likely in spec/spec_helper.rb , which is probably required by your specification. The top-level module is now called RSpec with capital S. For your question, you should have typed some error message manually, rather than copy and paste it. Your spec_helper should look something like this:

 # spec/spec_helper.rb RSpec.configure do |config| ... end 
+16
source

I encountered this error using security. I just had to change

 guard 'rspec', :version => 2 do 

to

 guard 'rspec' do 

in Guardfile .

+4
source

Source: https://habr.com/ru/post/905638/


All Articles