Class: Minitest::Subjective::Reporter

Inherits:
Reporter
  • Object
show all
Defined in:
lib/minitest/subjective/reporter.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io = $stdout, options = {}) ⇒ Reporter

Returns a new instance of Reporter.



8
9
10
11
# File 'lib/minitest/subjective/reporter.rb', line 8

def initialize(io = $stdout, options = {})
  super
  self.results = {}
end

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



6
7
8
# File 'lib/minitest/subjective/reporter.rb', line 6

def results
  @results
end

Instance Method Details

#record(result) ⇒ Object



13
14
15
# File 'lib/minitest/subjective/reporter.rb', line 13

def record(result)
  merge_result(result)
end

#reportObject



17
18
19
20
21
22
23
24
# File 'lib/minitest/subjective/reporter.rb', line 17

def report
  results.each do |subject_name, result|
    io.puts
    io.puts "Coverage for #{subject_name}:"
    io.puts coverage_headline_for(result)
    io.puts result.to_s unless result.covered?
  end
end