spec/command/listing_spec.rb
def clean_expected(expected)
  cleaned = expected.chomp

  indent_count = cleaned.scan(/ ^ [ ]+ /x).collect(&:length).min
  cleaned.gsub!(/ ^ [ ]{#{indent_count}} /x, '')

  return cleaned
end
# Allow for indenting in expected output given in heredocs.
Allow for indenting in expected output given in heredocs.
Allow for indenting in expected output given in heredocs .
def clean_expected(expected)
  cleaned = expected.chomp
  indent_count = cleaned.scan(/ ^ [ ]+ /x).collect(&:length).min
  cleaned.gsub!(/ ^ [ ]{#{indent_count}} /x, '')
  return cleaned
end
def clean_expected ( expected ) cleaned = expected . chomp indent_count = cleaned . scan ( /  ^ [ ]+  /x ) . collect ( & :length ) . min cleaned . gsub! ( /  ^ [ ]{ #{ indent_count } }  /x , '' ) return cleaned end
Allow for indenting in expected output given in heredocs.
Allow for indenting in expected output given in heredocs .
expected