class Blink1Rspec3Formatter

Constants

COLOR_FAIL
COLOR_PENDING
COLOR_SUCCESS

Public Class Methods

new(output) click to toggle source
# File lib/blink1_rspec3_formatter.rb, line 14
def initialize(output)
  @output = output
  @status = {failure: 0, pending: 0}
end

Public Instance Methods

close(notification) click to toggle source
# File lib/blink1_rspec3_formatter.rb, line 31
def close(notification)

  blink1 = Blink1.new
  blink1.open

  blink_color_and_count = get_color_and_blink_count
  color = blink_color_and_count[:color]
  count = blink_color_and_count[:count]

  if count > 0
    blink1.blink(color[0], color[1], color[2], count)
  end

  blink1.set_rgb(color[0], color[1], color[2])

  sleep(BLINK_TIMES)

  blink1.off
  blink1.close
end
dump_failures(notification) click to toggle source
# File lib/blink1_rspec3_formatter.rb, line 19
def dump_failures(notification)
  unless notification.failure_notifications.empty?
    @status[:failure] = notification.failed_examples.size
  end
end
dump_pending(notification) click to toggle source
# File lib/blink1_rspec3_formatter.rb, line 25
def dump_pending(notification)
  unless notification.pending_examples.empty?
    @status[:pending] = notification.pending_examples.size
  end
end

Private Instance Methods