Sha256: 040e062bad45bbffa716a3ec762ce9d8321ef3597d5a64d9aa9ecbcb81eb0436

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

require "spec_helper"

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

  it_should_use tag: :lnNumType, name: "line_numbering"

  for_attribute(:count_by) do
    values = [5, -5]
    it_should_assign_and_output_xml values
    it_should_not_allow_floats
    it_should_not_allow_invalid_value
  end

  for_attribute(:distance) do
    it_should_assign_and_output_xml 720
    it_should_not_allow_negative_numbers
    it_should_not_allow_floats
    it_should_not_allow_invalid_value
  end

  for_attribute(:restart) do
    values = %i(continuous newPage newSection)
    it_should_assign_and_output_xml values
    it_should_not_allow_invalid_value
  end

  for_attribute(:start) do
    values = [5, -5]
    it_should_assign_and_output_xml values
    it_should_not_allow_floats
    it_should_not_allow_invalid_value
  end

  with_no_attributes_set do
    it_should_output "", assign: false
  end

  with_these_attributes_set(start: 3, count_by: 5) do
    it_should_output "<w:lnNumType w:countBy=\"5\" w:start=\"3\"/>", assign: false
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

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