Module: ManiokBdd::RSpec::DocumentationFormatter::InstanceMethods

Defined in:
lib/maniok_bdd/rspec/documentation_formatter.rb

Instance Method Summary collapse

Instance Method Details

#example_passed_with_steps(example) ⇒ Object



25
26
27
# File 'lib/maniok_bdd/rspec/documentation_formatter.rb', line 25

def example_passed_with_steps(example)
  example_passed_without_steps(example) unless example.options[:with_steps]
end

#example_started_with_steps(example) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/maniok_bdd/rspec/documentation_formatter.rb', line 16

def example_started_with_steps(example)
  example_started_without_steps(example)

  if example.options[:with_steps]
    full_message = "#{current_indentation}#{example.description}"
    output.puts fixed_color(full_message)
  end
end

#example_step_failed(example_group, type, message, options) ⇒ Object



46
47
48
49
# File 'lib/maniok_bdd/rspec/documentation_formatter.rb', line 46

def example_step_failed(example_group, type, message, options)
  full_message = "#{current_indentation}  #{type.to_s.capitalize} #{message} (FAILED)"
  output.puts failure_color(full_message)
end

#example_step_passed(example_group, type, message, options) ⇒ Object



29
30
31
32
# File 'lib/maniok_bdd/rspec/documentation_formatter.rb', line 29

def example_step_passed(example_group, type, message, options)
  full_message = "#{current_indentation}  #{type.to_s.capitalize} #{message}"
  output.puts success_color(full_message)
end

#example_step_pending(example_group, type, message, options) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
# File 'lib/maniok_bdd/rspec/documentation_formatter.rb', line 34

def example_step_pending(example_group, type, message, options)
  full_message = "#{current_indentation}  #{type.to_s.capitalize} #{message}"

  if options[:pending] && options[:pending] != true
    full_message << " (PENDING: #{options[:pending]})"
  else
    full_message << " (PENDING)"
  end

  output.puts pending_color(full_message)
end