require "spec_helper" require "pricecut" describe Pricecut::Elements::H2 do let(:visitor) { Pricecut::MarkdownVisitor.new } let(:root) do parse %<<h2>Heading</h2>> 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