module AttributeNormalizer
  module Normalizers
    module WhitespaceNormalizer
      def self.normalize(value, options = {})
        value.is_a?(String) ? value.gsub(/[^\S\n]+/, ' ').gsub(/\s+\n$/, "\n").strip : value
      end
    end
  end
end

module AttributeNormalizer
  module Normalizers
    module WhitespaceNormalizer
      def self.normalize(value, options = {})
        value.is_a?(String) ? value.gsub(/[^\S\n]+/, ' ').gsub(/\s?\n\s?/, "\n").strip : value
      end
    end
  end
end

Remove whitespaces adjacent to newline. Actually pass all tests
Remove whitespaces adjacent to newline. Actually pass all tests