当我通过bundler运行spec时,我没有错误......
bundle exec rspec -fd spec/controllers/blah.rb
但是当我通过binstub运行它来使用spring时,我会遇到很多错误:
./bin/rspec -fd spec/controllers/blah.rb
DEPRECATION WARNING: `serialized_attributes` is deprecated without replacement, and will be removed in Rails 5.0.
这是为什么?
我试过停止和开始;没有效果。
在config/environments/test.rb
我有这个:
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
供参考......
$ bundle list | grep -E '(rspec|spring)'
* rspec-core (3.0.4)
* rspec-expectations (3.0.4)
* rspec-mocks (3.0.4)
* rspec-rails (3.0.2)
* rspec-support (3.0.4)
* spring (1.7.2)
* spring-commands-rspec (1.0.4)
根据要求,我的./bin/rspec
文件......
$ cat ./bin/rspec
#!/usr/bin/env ruby
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
# frozen_string_literal: true
#
# This file was generated by Bundler.
#
# The application 'rspec' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require "rubygems"
require "bundler/setup"
load Gem.bin_path("rspec-core", "rspec")
答案 0 :(得分:0)
一个可能的修复是改变这个:
config.active_support.deprecation = :stderr
到
config.active_support.deprecation = :silence
然而,这并没有解释为什么它被压制为rspec,而不是通过spring?!