Sha256: 233a87ffe2c70cb3ecea86f56dfc9ca2ec2019db41d6abf9e1f80ec94262e9ed

Contents?: true

Size: 718 Bytes

Versions: 9

Compression:

Stored size: 718 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)
    
    begin
      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)
    rescue
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
fnando-test_notifier-0.0.10 lib/test_notifier/rspec.rb
fnando-test_notifier-0.1.0 lib/test_notifier/rspec.rb
test_notifier-0.1.4 lib/test_notifier/rspec.rb
test_notifier-0.1.3 lib/test_notifier/rspec.rb
test_notifier-0.1.2 lib/test_notifier/rspec.rb
test_notifier-0.1.1 lib/test_notifier/rspec.rb
test_notifier-0.1.0 lib/test_notifier/rspec.rb
test_notifier-0.0.9 lib/test_notifier/rspec.rb
test_notifier-0.0.8 lib/test_notifier/rspec.rb