require "spec_helper"
require "pricecut"

describe Pricecut::Elements::H4 do
  let(:visitor) { Pricecut::MarkdownVisitor.new }

  let(:root) do
    parse %<<h4>Heading</h4>>
  end

  subject { described_class.new(visitor, root) }

  describe "#output!" do
    it "appends a Markdown header with newline to the output" do
      subject.output!

      visitor.output.should eq("#### Heading ####\n")
    end
  end
end