Class: Dogespec::Formatter

Inherits:
RSpec::Core::Formatters::DocumentationFormatter
  • Object
show all
Defined in:
lib/dogespec/formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(output) ⇒ Formatter

Returns a new instance of Formatter.



6
7
8
9
# File 'lib/dogespec/formatter.rb', line 6

def initialize(output)
  super(output)
  @dogeifier = Dogeify.new
end

Instance Method Details

#failure_output(example, exception) ⇒ Object



21
22
23
24
# File 'lib/dogespec/formatter.rb', line 21

def failure_output(example, exception)
  msg = "#{dogeify(example.description.strip)} (FAILED: #{next_failure_index})"
  failure_color("#{current_indentation}#{msg}")
end

#passed_output(example) ⇒ Object



11
12
13
14
# File 'lib/dogespec/formatter.rb', line 11

def passed_output(example)
  msg = dogeify(example.description.strip)
  success_color("#{current_indentation}#{msg}")
end

#pending_output(example, message) ⇒ Object



16
17
18
19
# File 'lib/dogespec/formatter.rb', line 16

def pending_output(example, message)
  msg = "#{dogeify(example.description.strip)} (PENDING: #{dogeify(message)})"
  pending_color("#{current_indentation}#{msg}")
end