【发布时间】:2012-02-21 20:54:58
【问题描述】:
Rails 3.2.1 应用,使用 minitest 和 autotest-rails gems。
如果我运行“rake test”,输出是彩色的。但是如果我运行自动测试,输出不是彩色的。
使用自动测试时如何获得颜色输出?
这是我的 test_helper.rb:
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'turn/autorun'
Turn.config do |c|
# use one of output formats:
# :outline - turn's original case/test outline mode [default]
# :progress - indicates progress with progress bar
# :dotted - test/unit's traditional dot-progress mode
# :pretty - new pretty reporter
# :marshal - dump output as YAML (normal run mode only)
# :cue - interactive testing
c.format = :pretty
# turn on invoke/execute tracing, enable full backtrace
c.trace = true
# use humanized test names (works only with :outline format)
c.natural = true
end
class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
# Add more helper methods to be used by all tests here...
end
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 testunit