Class: NcFirstFail

Inherits:
Nc
  • Object
show all
Defined in:
lib/nc_first_fail.rb

Constant Summary

Constants inherited from Nc

Nc::FAILURE_EMOJI, Nc::SUCCESS_EMOJI

Instance Method Summary collapse

Instance Method Details

#dump_summary(notification) ⇒ Object


16
17
18
19
20
# File 'lib/nc_first_fail.rb', line 16

def dump_summary(notification)
  if notification.failure_count == 0
    super
  end
end

#example_failed(notification) ⇒ Object


6
7
8
9
10
11
12
13
14
# File 'lib/nc_first_fail.rb', line 6

def example_failed(notification)
  example = notification.example
  body = "#{example.[:full_description]}\n#{example.exception}"
  title = "#{FAILURE_EMOJI} #{directory_name}: Failure"
  unless @failed
    TerminalNotifier.notify body, title: title
  end
  @failed = true
end