Class: Minitest::Hyper::Reporter

Inherits:
StatisticsReporter
  • Object
show all
Defined in:
lib/minitest/hyper/reporter.rb

Defined Under Namespace

Classes: HashFormatter

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/hyper/reporter.rb', line 8

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

Instance Attribute Details

#all_resultsObject

Returns the value of attribute all_results.



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

def all_results
  @all_results
end

Instance Method Details

#record(result) ⇒ Object



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

def record(result)
  super
  all_results << result
end

#reportObject



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

def report
  super
  @report = Report.new(self)
  @report.write
  io.puts "Wrote HTML test report to #{ @report.url }"
end

#to_hObject



25
26
27
# File 'lib/minitest/hyper/reporter.rb', line 25

def to_h
  HashFormatter.as_hash(self)
end