Sha256: db81e2e0920f80a4d10900546fdf5ff22b9c7e8e242bc9d7b2ea30d44fd6f7e1

Contents?: true

Size: 698 Bytes

Versions: 17

Compression:

Stored size: 698 Bytes

Contents

# frozen_string_literal: true

require "minitest/reporters"
require "os"
require "terminal-notifier"

module Minitest
  module Reporters
    class MacosNotificationReporter < BaseReporter
      def report
        super
        show_notification if OS.mac?
      end

      private

      def show_notification
        text = "#{total_count} tests, #{failures} failures, #{errors} errors, #{skips} skips in #{total_time}"
        title = options[:title] || "Minitest"
        subtitle = (passed? ? "\u{1F49A} Success" : "\u{1F494} Failed")
        group = title.downcase.tr(" ", "-")

        TerminalNotifier.notify(text, title: title, subtitle: subtitle, group: group)
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
minitest-macos-notification-2.0.0 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-1.0.1 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-1.0.0 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.4.0 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.3.3 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.3.2 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.3.1 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.3.0 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.2.0 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.1.0 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.0.8 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.0.7 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.0.6 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.0.5 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.0.4 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.0.3 lib/minitest/reporters/macos_notification_reporter.rb
minitest-macos-notification-0.0.2 lib/minitest/reporters/macos_notification_reporter.rb