Sha256: c1a7044ab1bdcff31cb5d1a2f578a7db8dfe9e2a6ac71b693e585daa99211916

Contents?: true

Size: 1022 Bytes

Versions: 2

Compression:

Stored size: 1022 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

    with_value(-24) do
      it_should_raise_an_exception
    end

    with_value(:big) do
      it_should_raise_an_exception
    end
  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

    with_value(-24) do
      it_should_raise_an_exception
    end

    with_value(:big) do
      it_should_raise_an_exception
    end
  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

2 entries across 2 versions & 1 rubygems

Version Path
openxml-docx-0.8.0 spec/properties/numbering_spec.rb
openxml-docx-0.8.0.beta1 spec/properties/numbering_spec.rb