Class: Flatware::RSpec::Summary

Inherits:
RSpec::Core::Notifications::SummaryNotification
  • Object
show all
Defined in:
lib/flatware/rspec/summary.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_notification(summary) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/flatware/rspec/summary.rb', line 17

def self.from_notification(summary)
  serialized_examples = [summary.examples, summary.failed_examples, summary.pending_examples].map do |examples|
    examples.map(&Example.method(:new))
  end

  new summary.duration, *serialized_examples, *summary.to_a[4..-1]
end

Instance Method Details

#+(other) ⇒ Object



13
14
15
# File 'lib/flatware/rspec/summary.rb', line 13

def +(other)
  self.class.new(*zip(other).map {|a,b| a + b})
end