Class: SpecTracker::Reporter::Report

Inherits:
Object
  • Object
show all
Defined in:
lib/spec_tracker/reporter/report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, topic:) ⇒ Report

Returns a new instance of Report.



6
7
8
9
# File 'lib/spec_tracker/reporter/report.rb', line 6

def initialize(data:, topic:)
  @data = data
  @topic = topic
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/spec_tracker/reporter/report.rb', line 4

def data
  @data
end

#topicObject (readonly)

Returns the value of attribute topic.



4
5
6
# File 'lib/spec_tracker/reporter/report.rb', line 4

def topic
  @topic
end

Instance Method Details

#progressionObject



11
12
13
14
# File 'lib/spec_tracker/reporter/report.rb', line 11

def progression
  success_count = data.select {|report_datum| report_datum.status.success?}.size
  (success_count.to_f / data.size.to_f * 100).round(1)
end