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.



10
11
12
13
# File 'lib/minitest/subjective/reporter.rb', line 10

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

Instance Attribute Details

#resultsObject

Returns the value of attribute results.



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

def results
  @results
end

Instance Method Details

#record(result) ⇒ Object



15
16
17
# File 'lib/minitest/subjective/reporter.rb', line 15

def record(result)
  merge_result(result)
end

#reportObject



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

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