class RSpec::Core::Formatters::VerboseFormatter

Public Class Methods

new(output) click to toggle source
Calls superclass method
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 8
def initialize(output)
  super(output)
  @group_level = 0
end

Public Instance Methods

current_indentation() click to toggle source
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 53
def current_indentation
  '  ' * @group_level
end
example_failed(example) click to toggle source
Calls superclass method
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 40
def example_failed(example)
  super(example)
  puts failure_output(example, example.execution_result[:exception])
end
example_group_finished(example_group) click to toggle source
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 22
def example_group_finished(example_group)
  @group_level -= 1
end
example_group_started(example_group) click to toggle source
Calls superclass method
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 13
def example_group_started(example_group)
  super(example_group)

  puts if @group_level == 0
  puts "#{current_indentation}#{example_group.description.strip}"

  @group_level += 1
end
example_passed(example) click to toggle source
Calls superclass method
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 26
def example_passed(example)
  super(example)
  if respond_to? :success_color
    puts success_color("\e[32m  OK " + example.description.strip + "\e[0m")
  else
    puts "\e[32m  OK " + example.description.strip + "\e[0m"
  end
end
example_pending(example) click to toggle source
Calls superclass method
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 35
def example_pending(example)
  super(example)
  puts pending_color(example.description.strip)
end
failure_output(example, exception) click to toggle source
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 45
def failure_output(example, exception)
  if respond_to? :failure_color
    failure_color("\e[31mKO #{example.exception.message} (FAILED - #{next_failure_index})\e[0m")
  else
    "\e[31mKO #{example.exception.message} (FAILED - #{next_failure_index})\e[0m"
  end
end
next_failure_index() click to toggle source
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 57
def next_failure_index
  @next_failure_index ||= 0
  @next_failure_index += 1
end
start_dump() click to toggle source
# File lib/g5kchecks/rspec/core/formatters/verbose_formatter.rb, line 62
def start_dump
  output.puts
end