Class: Flatware::RSpec::Marshalable::SummaryNotification

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_rspec(summary) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/flatware/rspec/marshalable/summary_notification.rb', line 16

def self.from_rspec(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..])
end

Instance Method Details

#+(other) ⇒ Object



8
9
10
# File 'lib/flatware/rspec/marshalable/summary_notification.rb', line 8

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

#failures?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/flatware/rspec/marshalable/summary_notification.rb', line 12

def failures?
  [failure_count, errors_outside_of_examples_count].any?(&:positive?)
end