Sha256: cfc8413c1d6575f4d46cb4fc60bfd8abff6e292261d0fc69b5613d18fab18da9

Contents?: true

Size: 664 Bytes

Versions: 1

Compression:

Stored size: 664 Bytes

Contents

require 'test_notifier'
require 'spec/runner/formatter/base_text_formatter'

class Spec::Runner::Formatter::BaseTextFormatter
  alias dump_summary_original dump_summary
  
  def dump_summary(duration, examples, failed, pending)
    dump_summary_original(duration, examples, failed, pending)
    
    return if examples == 0
    
    if failed > 0
      title = TestNotifier::FAILURE_TITLE
      image = TestNotifier::ERROR_IMAGE
    else
      title = TestNotifier::PASSED_TITLE
      image = TestNotifier::PASSED_IMAGE
    end
    
    message = "#{examples} examples, #{failed} failed, #{pending} pending"
    TestNotifier.notify(image, title, message)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
test_notifier-0.0.7 lib/test_notifier/rspec.rb