Module: SimpleCov::Formatter

Defined in:
lib/simplecov/formatter.rb,
lib/simplecov/default_formatter.rb,
lib/simplecov/formatter/multi_formatter.rb,
lib/simplecov/formatter/simple_formatter.rb

Overview

TODO: Documentation on how to build your own formatters

Defined Under Namespace

Classes: MultiFormatter, SimpleFormatter

Class Method Summary collapse

Class Method Details

.from_env(env) ⇒ Object


7
8
9
10
11
12
13
14
15
16
17
# File 'lib/simplecov/default_formatter.rb', line 7

def from_env(env)
  formatters = [SimpleCov::Formatter::HTMLFormatter]

  # When running under a CI that uses CodeClimate, JSON output is expected
  if env.fetch("CC_TEST_REPORTER_ID", nil)
    require "simplecov_json_formatter"
    formatters.push(SimpleCov::Formatter::JSONFormatter)
  end

  formatters
end