Class: Flatware::RSpec::ExamplesNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/flatware/rspec/examples_notification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(failure_notifications) ⇒ ExamplesNotification

Returns a new instance of ExamplesNotification.



7
8
9
# File 'lib/flatware/rspec/examples_notification.rb', line 7

def initialize(failure_notifications)
  @failure_notifications = failure_notifications.map(&ExampleNotification.method(:new))
end

Instance Attribute Details

#failure_notificationsObject (readonly)

Returns the value of attribute failure_notifications.



5
6
7
# File 'lib/flatware/rspec/examples_notification.rb', line 5

def failure_notifications
  @failure_notifications
end

Instance Method Details

#+(other) ⇒ Object



11
12
13
# File 'lib/flatware/rspec/examples_notification.rb', line 11

def +(other)
  self.class.new failure_notifications + other.failure_notifications
end

#fully_formatted_failed_examplesObject



15
16
17
18
19
20
21
# File 'lib/flatware/rspec/examples_notification.rb', line 15

def fully_formatted_failed_examples(*)
  formatted = "\n\nFailures:\n"
  failure_notifications.each_with_index do |failure, index|
    formatted << failure.fully_formatted(index.next)
  end
  formatted
end