class RSpec3

Attributes

example_name[R]

Public Class Methods

new(output) click to toggle source
Calls superclass method
# File lib/nyan_cat_formatter/rspec3.rb, line 12
def initialize(output)
  super(output)
  # @failure_count = 0
  # @pending_count = 0
end

Public Instance Methods

dump_summary(notification) click to toggle source
# File lib/nyan_cat_formatter/rspec3.rb, line 59
def dump_summary(notification)
  duration      = notification.duration
  summary = "\nYou've Nyaned for #{format_duration(duration)}\n".split(//).map { |c| rainbowify(c) }
  output.puts summary.join
  output.puts notification.fully_formatted
  if respond_to?(:dump_commands_to_rerun_failed_examples)
    dump_commands_to_rerun_failed_examples
  end
end
example_failed(notification) click to toggle source
# File lib/nyan_cat_formatter/rspec3.rb, line 49
def example_failed(notification)
  @failed_examples << notification
  @failure_count += 1
  tick FAIL
end
example_passed(notification) click to toggle source
# File lib/nyan_cat_formatter/rspec3.rb, line 39
def example_passed(notification)
  tick PASS
end
example_pending(notification) click to toggle source
# File lib/nyan_cat_formatter/rspec3.rb, line 43
def example_pending(notification)
  @pending_examples << notification
  @pending_count += 1
  tick PENDING
end
example_started(notification) click to toggle source
# File lib/nyan_cat_formatter/rspec3.rb, line 32
def example_started(notification)
  if notification.respond_to?(:example)
    notification = notification.example
  end
  @example_name = notification.full_description
end
start(notification) click to toggle source
Calls superclass method
# File lib/nyan_cat_formatter/rspec3.rb, line 18
def start(notification)
  # TODO: Lazy fix for specs.
  if notification.kind_of?(Integer)
    super(OpenStruct.new(:count => notification))
  else
    super(notification)
  end

  @current = @color_index = @passing_count = @failure_count = @pending_count = 0
  @example_results = []
  @failed_examples = []
  @pending_examples = []
end
start_dump(notification) click to toggle source
# File lib/nyan_cat_formatter/rspec3.rb, line 55
def start_dump(notification)
  @current = @example_count
end