require "spec_helper" describe "The Section Builder" do let(:builder) do inputs = [ [1, ["

Heading

"]], [1, ["

Section Heading

"]], [2, ["

a

"]], [2, ["

b

"]], [2, ["

c

"]], [1, ["

Footer

"]] ] Brief::Document::Section::Builder.new(inputs) end it "collapses the HTML into sections for us" do expect(builder.to_fragment.css("section h1").count).to eq(3) expect(builder.to_fragment.css("section article").count).to eq(3) end end