Sha256: 76838c9211ab40056f11f8f8fd49cdefc5550876027746ade1c8712144c38fb2

Contents?: true

Size: 501 Bytes

Versions: 3

Compression:

Stored size: 501 Bytes

Contents

require 'nc'

class NcFirstFail < Nc
  RSpec::Core::Formatters.register self, :example_failed

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

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

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
gameboard-3.1.0 vendor/bundle/ruby/2.3.0/gems/rspec-nc-0.3.0/lib/nc_first_fail.rb
gameboard-3.0.0 vendor/bundle/ruby/2.3.0/gems/rspec-nc-0.3.0/lib/nc_first_fail.rb
rspec-nc-0.3.0 lib/nc_first_fail.rb