You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: additional_cli_steps.rb
    path of file: ./repos/rspec-core/features/step_definitions
    
    the code of the file until where you have to start completion: require 'rspec/core'  # to fix annoying "undefined method `configuration' for RSpec:Module (NoMethodError)"

require './spec/support/form
    
  def normalize_failure_output(text)
    whitespace_normalized = text.lines.map { |line| line.sub(/\s+$/, '').sub(/:in .*$/, '') }.join

    # 1.8.7 and JRuby produce slightly different output for `Hash#fetch` errors, so we
    # convert it to the same output here to match our expectation.
    whitespace_normalized.
      sub("IndexError", "KeyError").
      sub(/key not found.*$/, "key not found")
  end