Module: RSpec::Specify::InstanceMethods

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

Instance Method Summary collapse

Instance Method Details

#example_passed_with_steps(notification) ⇒ Object



52
53
54
# File 'lib/specify/rspec/documentation_formatter.rb', line 52

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

#example_started(notification) ⇒ Object



18
19
# File 'lib/specify/rspec/documentation_formatter.rb', line 18

def example_started(notification)
end

#example_started_with_steps(notification) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/specify/rspec/documentation_formatter.rb', line 43

def example_started_with_steps(notification)
  example_started_without_steps(notification)

  if notification.example.[:with_steps]
    full_message = "#{current_indentation}#{notification.example.description}"
    output.puts Core::Formatters::ConsoleCodes.wrap(full_message, :default)
  end
end

#example_step_failed(notification) ⇒ Object



26
27
28
29
# File 'lib/specify/rspec/documentation_formatter.rb', line 26

def example_step_failed(notification)
  full_message = "#{current_indentation}  #{notification.type.to_s.capitalize} #{notification.message} (FAILED)"
  output.puts Core::Formatters::ConsoleCodes.wrap(full_message, :failure)
end

#example_step_passed(notification) ⇒ Object



21
22
23
24
# File 'lib/specify/rspec/documentation_formatter.rb', line 21

def example_step_passed(notification)
  full_message = "#{current_indentation}  #{notification.type.to_s.capitalize} #{notification.message}"
  output.puts Core::Formatters::ConsoleCodes.wrap(full_message, :success)
end

#example_step_pending(notification) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/specify/rspec/documentation_formatter.rb', line 31

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

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

  output.puts Core::Formatters::ConsoleCodes.wrap(full_message, :pending)
end