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.9.4 spec/lib/brief/section_builder_spec.rb
brief-1.9.3 spec/lib/brief/section_builder_spec.rb
brief-1.9.2 spec/lib/brief/section_builder_spec.rb
brief-1.9.1 spec/lib/brief/section_builder_spec.rb
brief-1.9.0 spec/lib/brief/section_builder_spec.rb
brief-1.8.12 spec/lib/brief/section_builder_spec.rb
brief-1.8.11 spec/lib/brief/section_builder_spec.rb
brief-1.8.10 spec/lib/brief/section_builder_spec.rb
brief-1.8.9 spec/lib/brief/section_builder_spec.rb
brief-1.8.8 spec/lib/brief/section_builder_spec.rb
brief-1.8.6 spec/lib/brief/section_builder_spec.rb
brief-1.8.5 spec/lib/brief/section_builder_spec.rb
brief-1.8.4 spec/lib/brief/section_builder_spec.rb
brief-1.8.3 spec/lib/brief/section_builder_spec.rb
brief-1.8.2 spec/lib/brief/section_builder_spec.rb
brief-1.8.1 spec/lib/brief/section_builder_spec.rb
brief-1.8.0 spec/lib/brief/section_builder_spec.rb
brief-1.7.3 spec/lib/brief/section_builder_spec.rb
brief-1.7.2 spec/lib/brief/section_builder_spec.rb
brief-1.7.1 spec/lib/brief/section_builder_spec.rb