如何让 Minitest-Reporters 使用 Rails 5?
How to make Minitest-Reporters work with Rails 5?
我一直在关注 Rails Tutorial and I'm trying to incorporate the Minitest Reporters gem to my project as per instructions on section 3.7.1
所以,test/test_helper.rb:
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/reporters"
Minitest::Reporters.use!
还有 Gemfile:
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
我能够 运行 bundle install --without production
正常。应用程序中的其他所有内容(包括测试)运行 都很顺利,但我没有得到与教程中相同的 look/feel:
我怎样才能做到这一点?
这是我在 test_helper.rb 中与较新的 rails 一起使用的(不确定我是否在 rails5 中尝试过):
require "minitest/reporters"
Minitest::Reporters.use!(Minitest::Reporters::ProgressReporter.new,ENV,Minitest.backtrace_filter)
经过几天的搜索,我发现这个问题已在 Github 存储库 (rails/rails) 的 Master 分支的最新版本上得到修复。
我一直在关注 Rails Tutorial and I'm trying to incorporate the Minitest Reporters gem to my project as per instructions on section 3.7.1
所以,test/test_helper.rb:
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/reporters"
Minitest::Reporters.use!
还有 Gemfile:
group :test do
gem 'minitest-reporters', '1.0.5'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.1'
end
我能够 运行 bundle install --without production
正常。应用程序中的其他所有内容(包括测试)运行 都很顺利,但我没有得到与教程中相同的 look/feel:
我怎样才能做到这一点?
这是我在 test_helper.rb 中与较新的 rails 一起使用的(不确定我是否在 rails5 中尝试过):
require "minitest/reporters"
Minitest::Reporters.use!(Minitest::Reporters::ProgressReporter.new,ENV,Minitest.backtrace_filter)
经过几天的搜索,我发现这个问题已在 Github 存储库 (rails/rails) 的 Master 分支的最新版本上得到修复。