debian-mirror-gitlab/spec/lib/banzai/filter/normalize_source_filter_spec.rb
2021-01-29 00:20:46 +05:30

27 lines
543 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Banzai::Filter::NormalizeSourceFilter do
include FilterSpecHelper
it 'removes the UTF8 BOM from the beginning of the text' do
content = "\xEF\xBB\xBF---"
output = filter(content)
expect(output).to match '---'
end
it 'does not remove those characters from anywhere else in the text' do
content = <<~MD
\xEF\xBB\xBF---
\xEF\xBB\xBF---
MD
output = filter(content)
expect(output).to match "---\n\xEF\xBB\xBF---\n"
end
end