module RSpec::Core::Formatters::ConsoleCodes

def wrap(text, code_or_symbol)

Returns:
  • (String) - the wrapped text

Parameters:
  • code_or_symbol (Symbol, Fixnum) -- the desired control code
  • text (String) -- the text to wrap
def wrap(text, code_or_symbol)
  if RSpec.configuration.color_enabled?
    "\e[#{console_code_for(code_or_symbol)}m#{text}\e[0m"
  else
    text
  end
end