Sha256: 092b691bd7164aeef4b455ec4c0f3c5c3a531300bd5d18d73c04cba2a299c702

Contents?: true

Size: 651 Bytes

Versions: 93

Compression:

Stored size: 651 Bytes

Contents

require "spec_helper"

describe "The Section Builder" do
  let(:builder) do
    inputs = [
      [1, ["<section><h1>Heading</h1></section>"]],
      [1, ["<section><h1>Section Heading</h1></section>"]],
      [2, ["<article><h2>a</h2></article>"]],
      [2, ["<article><h2>b</h2></article>"]],
      [2, ["<article><h2>c</h2></article>"]],
      [1, ["<section><h1>Footer</h1></section>"]]
    ]

    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

Version data entries

93 entries across 93 versions & 1 rubygems

Version Path
brief-1.17.14 spec/lib/brief/section_builder_spec.rb
brief-1.17.13 spec/lib/brief/section_builder_spec.rb
brief-1.17.12 spec/lib/brief/section_builder_spec.rb
brief-1.17.11 spec/lib/brief/section_builder_spec.rb
brief-1.17.10 spec/lib/brief/section_builder_spec.rb
brief-1.17.9 spec/lib/brief/section_builder_spec.rb
brief-1.17.8 spec/lib/brief/section_builder_spec.rb
brief-1.17.7 spec/lib/brief/section_builder_spec.rb
brief-1.17.5 spec/lib/brief/section_builder_spec.rb
brief-1.17.4 spec/lib/brief/section_builder_spec.rb
brief-1.17.3 spec/lib/brief/section_builder_spec.rb
brief-1.17.2 spec/lib/brief/section_builder_spec.rb
brief-1.17.1 spec/lib/brief/section_builder_spec.rb
brief-1.17.0 spec/lib/brief/section_builder_spec.rb
brief-1.16.2 spec/lib/brief/section_builder_spec.rb
brief-1.16.1 spec/lib/brief/section_builder_spec.rb
brief-1.16.0 spec/lib/brief/section_builder_spec.rb
brief-1.15.5 spec/lib/brief/section_builder_spec.rb
brief-1.15.4 spec/lib/brief/section_builder_spec.rb
brief-1.15.3 spec/lib/brief/section_builder_spec.rb