Sha256: c95e3c47d13af8c88a9e91c17d37d16198015e747ea43e82730c8a5fea98251b

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 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, example_count, failure_count, pending_count)
    dump_summary_original(duration, example_count, failure_count, pending_count)

    return if example_count.zero?

    stats = TestNotifier::Stats.new(:spec, {
      :total   => example_count,
      :fail    => failure_count,
      :pending => pending_count,
      :error   => nil
    })

    TestNotifier.notify(:status => stats.status, :message => stats.message) if example_count > 0
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
test_notifier-0.3.2 lib/test_notifier/runner/spec.rb
test_notifier-0.3.1 lib/test_notifier/runner/spec.rb