Sha256: ed2d7fd2cdf62bc53bb8e2d3db41f96bc59678a4d39762b0a2c6dd02d3fcb7a0
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true require "test_notifier" Autotest.add_hook :ran_command do |at| content = at.results.to_s rspec_re = /(\d+) examples?, (\d+) failures?(, (\d+) pendings?)?/ test_unit_re = /(\d+) tests, (\d+) assertions, (\d+) failures, (\d+) errors/ rspec_matches = content.match(rspec_re) test_unit_matches = content.match(test_unit_re) if rspec_matches _, examples, failures, _, pending = *rspec_matches stats = TestNotifier::Stats.new( :spec, { count: examples, failures: failures, pending: pending } ) unless examples.to_i.zero? TestNotifier.notify(status: stats.status, message: stats.message) end elsif test_unit_matches _, tests, assertions, failures, errors = *test_unit_matches stats = TestNotifier::Stats.new( :test_unit, { count: tests, assertions: assertions, failures: failures, errors: errors } ) unless tests.to_i.zero? TestNotifier.notify(status: stats.status, message: stats.message) end end rescue StandardError => error puts error puts error.backtrace end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
test_notifier-2.1.0 | lib/test_notifier/runner/autotest.rb |