Sha256: f631807b9f635c19c15e86f3f87a009d6935d4bf28b27ea5bffa6b1c81133d33
Contents?: true
Size: 833 Bytes
Versions: 1
Compression:
Stored size: 833 Bytes
Contents
require "minitest/blink1_reporter/class" require "blink1" module Minitest class Blink1Reporter SUCCESS = [0, 170, 0] SKIPPED = [180, 150, 0] FAILURE = [180, 0, 0] RUNNING = [170, 0, 180] FADE = 150 def initialize(_options) @results = [] end def record(result) blink1.fade_to_rgb(FADE, *RUNNING) @results << result end def report if @results.any?(&:skipped?) blink1.fade_to_rgb(FADE, *SKIPPED) elsif !@results.all?(&:passed?) blink1.fade_to_rgb(FADE, *FAILURE) else blink1.fade_to_rgb(FADE, *SUCCESS) end blink1.close end private def blink1 @blink1 ||= ::Blink1.new.tap(&:open) end end def self.plugin_blink1_reporter_init(options) reporter << Blink1Reporter.new(options) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
minitest-blink1_reporter-0.1.1 | lib/minitest/blink1_reporter_plugin.rb |