Sha256: b8c6b588ede2d069fda7545bdac8a0e1b1b65fcd2c78175bc0fd207dfadf5222

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

require "test_notifier"
require "rspec/core/formatters/base_text_formatter"

class RSpec::Core::Formatters::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(:rspec, {
      :total   => example_count,
      :fail    => failure_count,
      :pending => pending_count,
      :error   => examples.reject {|e| e.instance_variable_get("@exception").nil?}.count
    })

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
test_notifier-0.3.1 lib/test_notifier/runner/rspec.rb