class RSpec::Specify::Formatter

Public Instance Methods

example_passed(notification) click to toggle source
Calls superclass method
# File lib/specify/rspec/formatter.rb, line 26
def example_passed(notification)
  super unless notification.example.metadata[:has_steps]
end
example_started(notification) click to toggle source
# File lib/specify/rspec/formatter.rb, line 14
def example_started(notification)
  return unless notification.example.metadata[:has_steps]

  indentation = current_indentation
  description = notification.example.description

  full_message = "#{indentation}#{description}"
  output.puts(
    ::RSpec::Core::Formatters::ConsoleCodes.wrap(full_message, :default)
  )
end
example_step_failed(notification) click to toggle source
# File lib/specify/rspec/formatter.rb, line 41
def example_step_failed(notification)
  indentation = current_indentation
  step_type = notification.type.to_s.capitalize
  step_message = notification.message

  full_message = "#{indentation}  #{step_type} #{step_message} (FAILED)"
  output.puts(
    ::RSpec::Core::Formatters::ConsoleCodes.wrap(full_message, :failure)
  )
end
example_step_passed(notification) click to toggle source
# File lib/specify/rspec/formatter.rb, line 30
def example_step_passed(notification)
  indentation = current_indentation
  step_type = notification.type.to_s.capitalize
  step_message = notification.message

  full_message = "#{indentation}  #{step_type} #{step_message}"
  output.puts(
    ::RSpec::Core::Formatters::ConsoleCodes.wrap(full_message, :success)
  )
end
example_step_pending(notification) click to toggle source
# File lib/specify/rspec/formatter.rb, line 52
def example_step_pending(notification)
  indentation = current_indentation
  step_type = notification.type.to_s.capitalize
  step_message = notification.message

  full_message = "#{indentation}  #{step_type} #{step_message}"

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

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