summaryrefslogtreecommitdiffhomepage
path: root/tests/_test_helper.rb
blob: 6612b386345705c7cc43e1d42fece980ee556c83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require 'simplecov'
require 'simplecov_json_formatter'
#require 'simplecov_small_badge'

# SimpleCovSmallBadge fix
=begin
SimpleCovSmallBadge::Formatter.class_eval do
  private
  def state(covered_percent)
    if SimpleCov.minimum_coverage[:line]&.positive?
      if covered_percent >= SimpleCov.minimum_coverage[:line]
        'good'
      else
        'bad'
      end
    else
      'unknown'
    end
  end
end
=end

SimpleCov.start do
  SimpleCov.add_filter 'tests'
  SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new([
    SimpleCov::Formatter::HTMLFormatter,
    SimpleCov::Formatter::JSONFormatter
    #SimpleCovSmallBadge::Formatter
  ])
end

require 'minitest/autorun'
require 'minitest/reporters'

Minitest::Reporters.use!