class RSpec::Support::ObjectFormatter
def truncate_string(str, start_index, end_index)
will be removed as printing partial ANSI
If the string ends with a partial ANSI code code then that
Returns the substring defined by the start_index and end_index
def truncate_string(str, start_index, end_index) cut_str = str[start_index..end_index] # ANSI color codes are like: \e[33m so anything with \e[ and a # number without a 'm' is an incomplete color code cut_str.sub(/\e\[\d+$/, '') end