Sha256: 083476229def2ba80e49287eeb7a161fd721895fbdaa28946d2bc98460b8b324

Contents?: true

Size: 913 Bytes

Versions: 8

Compression:

Stored size: 913 Bytes

Contents

require "spec_helper"

describe OpenXml::Docx::Properties::Numbering do
  include PropertyTestMacros

  it_should_use tag: :numPr, name: "numbering"

  for_attribute(:level) do
    with_value(24) do
      it_should_assign_successfully
      it_should_output "<w:numPr>\n    <w:ilvl w:val=\"24\"/>\n  </w:numPr>"
    end

    it_should_not_allow_negative_numbers
    it_should_not_allow_invalid_value

  end

  for_attribute(:id) do
    with_value(24) do
      it_should_assign_successfully
      it_should_output "<w:numPr>\n    <w:numId w:val=\"24\"/>\n  </w:numPr>"
    end

    it_should_not_allow_negative_numbers
    it_should_not_allow_invalid_value
  end

  with_no_attributes_set do
    it_should_output "", assign: false
  end

  with_these_attributes_set(level: 4, id: 0) do
    it_should_output "<w:numPr>\n    <w:ilvl w:val=\"4\"/>\n    <w:numId w:val=\"0\"/>\n  </w:numPr>", assign: false
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
openxml-docx-0.10.6 spec/properties/numbering_spec.rb
openxml-docx-0.10.5 spec/properties/numbering_spec.rb
openxml-docx-0.10.4 spec/properties/numbering_spec.rb
openxml-docx-0.10.3 spec/properties/numbering_spec.rb
openxml-docx-0.10.2 spec/properties/numbering_spec.rb
openxml-docx-0.10.1 spec/properties/numbering_spec.rb
openxml-docx-0.10.0 spec/properties/numbering_spec.rb
openxml-docx-0.9.0 spec/properties/numbering_spec.rb