1

尝试从 2.14.2 升级到 rspec 3.x 获取贬值消息

The `:example_group` key in an example group's metadata hash is deprecated. Use the example group's hash directly for the computed keys and `:parent_example_group` to access the parent example group metadata instead. Called from /home/georgi/ruby/xxx/spec/models/user_spec.rb:2:in `<top (required)>'.

此消息显示在规范文件中具有“描述”的每一行。我在测试环境中使用的宝石是

group :development, :test do
  gem 'rspec-rails'
end

group :test do
  gem 'factory_girl_rails'
  gem 'database_cleaner'
  gem 'capybara'
  gem 'poltergeist'
  gem 'selenium-webdriver', '~> 2.42.0'
  gem 'shoulda-matchers'
  gem 'rspec-retry'
  gem 'simplecov'
end

来自 config.raise_errors_for_deprecations 的信息!配置:

https://gist.github.com/tapalilov/b96b4e2f4237e2ecef84

如何删除这些弃用消息以及如何更改 rspec 配置?

最好的问候,乔治。

4

0 回答 0