summaryrefslogtreecommitdiff
path: root/spec/lib/banzai/pipeline/pre_process_pipeline_spec.rb
blob: fc74c592867e1dbc8edca39bf8f7a588bf92406e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Banzai::Pipeline::PreProcessPipeline do
  it 'pre-processes the source text' do
    markdown = <<~MD
      \xEF\xBB\xBF---
      foo: :foo_symbol
      bar: :bar_symbol
      ---

      >>>
      blockquote
      >>>
    MD

    result = described_class.call(markdown, {})

    aggregate_failures do
      expect(result[:output]).not_to include "\xEF\xBB\xBF"
      expect(result[:output]).not_to include '---'
      expect(result[:output]).to include "```yaml\nfoo: :foo_symbol\n"
      expect(result[:output]).to include "> blockquote\n"
    end
  end
end