当我运行我的规范时,我得到了这个错误,即使我从来没有在我的代码中的任何地方包含 minitest:
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
这是rails 4 master。
这是我的 spec_helper.rb 的顶部:
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
这是堆栈跟踪:
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
From:
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `block in require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/2.1.0/test/unit/assertions.rb:1:in `<top (required)>'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `block in require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/gems/rspec-rails-2.14.0/lib/rspec/rails/adapters.rb:3:in `<top (required)>'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `block in require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/gems/rspec-rails-2.14.0/lib/rspec/rails.rb:11:in `<top (required)>'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `block in require'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:223:in `load_dependency'
/Users/john/.rbenv/versions/2.1.0-preview1/lib/ruby/gems/2.1.0/bundler/gems/rails-e5f5a838b96a/activesupport/lib/active_support/dependencies.rb:238:in `require'
/Users/john/foobar/spec/spec_helper.rb:3:in `<top (required)>'