Module: Minitest::Reporters::ANSI::Code

Extended by:
ANSI::Code, Code
Includes:
ANSI::Code
Included in:
Code, DefaultReporter, ProgressReporter, SpecReporter
Defined in:
lib/minitest/reporters/ansi.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.color?Boolean

Returns:

  • (Boolean)

5
6
7
8
9
# File 'lib/minitest/reporters/ansi.rb', line 5

def self.color?
  return false if ENV['MINITEST_REPORTERS_MONO']
  color_terminal = ENV['TERM'].to_s.downcase.include?("color")
  $stdout.tty? || color_terminal
end

Instance Method Details

#black(s = nil)


17
18
19
# File 'lib/minitest/reporters/ansi.rb', line 17

def black(s = nil)
  block_given? ? yield : s
end