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)


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

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)



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

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