Aplikacja Rails 3.2.1, przy użyciu klejnotów minitest i autotest-rails.Jak mogę uzyskać wydruk koloru w autotestie za pomocą Test/Unit, MiniTest?
Jeśli uruchomię "test prowizji", wydruk będzie kolorowy. Ale jeśli uruchomię autotest, dane wyjściowe nie będą kolorowe.
Jak uzyskać wydruk kolorowy podczas korzystania z autotestu?
Oto mój 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
Oba te linki wydają się być martwe :( – alnorth29
Post ma więcej niż 12 miesięcy! W przypadku obu wspomnianych technik obie techniki, które tu zostały udokumentowane, przestały działać, ale teoria brzmi dobrze, będziesz mieć znaleźć w kodzie, lub zapytać autora klejnotu, czy istnieje sposób na wymuszenie koloryzacji, pomijając sprawdzenie, czy dane wyjściowe są tty. –