Sha256: bb209e0273c37cf2e6ae2583dcb6b0a75ac0e05c027d9fea03dd30af741c4e2e

Contents?: true

Size: 1.4 KB

Versions: 26

Compression:

Stored size: 1.4 KB

Contents

require "test_helper"
require "support/document_xml_helper"

class SectionPropertiesTest < Sablon::TestCase
  include DocumentXMLHelper

  def test_assign_start_page_number_with_pgNumType_tag
    xml = wrap <<-documentxml
<w:body>
  <w:sectPr w:rsidR="00FC1AFD" w:rsidSect="006745DF">
    <w:pgSz w:w="11900" w:h="16840"/>
    <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/>
    <w:pgNumType w:start="1"/>
    <w:cols w:space="708"/>
    <w:docGrid w:linePitch="360"/>
  </w:sectPr>
</w:body>
    documentxml
    properties = Sablon::Processor::SectionProperties.from_document(xml)
    assert_equal "1", properties.start_page_number
    properties.start_page_number = "23"
    assert_equal "23", properties.start_page_number
  end

  def test_assign_start_page_number_without_pgNumType_tag
    xml = wrap <<-documentxml
<w:body>
  <w:sectPr w:rsidR="00FC1AFD" w:rsidSect="006745DF">
    <w:pgSz w:w="11900" w:h="16840"/>
    <w:pgMar w:top="1440" w:right="1800" w:bottom="1440" w:left="1800" w:header="708" w:footer="708" w:gutter="0"/>
    <w:cols w:space="708"/>
    <w:docGrid w:linePitch="360"/>
  </w:sectPr>
</w:body>
    documentxml
    properties = Sablon::Processor::SectionProperties.from_document(xml)
    assert_equal nil, properties.start_page_number
    properties.start_page_number = "16"
    assert_equal "16", properties.start_page_number
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
sablon-0.0.21 test/section_properties_test.rb
sablon-0.0.20 test/section_properties_test.rb
sablon-0.0.19 test/section_properties_test.rb
sablon-0.0.19.beta5 test/section_properties_test.rb
sablon-0.0.19.beta4 test/section_properties_test.rb
sablon-0.0.19.beta3 test/section_properties_test.rb
sablon-0.0.19.beta2 test/section_properties_test.rb
sablon-0.0.19.beta1 test/section_properties_test.rb
sablon-0.0.18 test/section_properties_test.rb
sablon-0.0.17 test/section_properties_test.rb
sablon-0.0.16 test/section_properties_test.rb
sablon-0.0.15 test/section_properties_test.rb
sablon-0.0.14 test/section_properties_test.rb
sablon-0.0.13 test/section_properties_test.rb
sablon-0.0.12 test/section_properties_test.rb
sablon-0.0.11 test/section_properties_test.rb
sablon-0.0.10 test/section_properties_test.rb
sablon-0.0.9 test/section_properties_test.rb
sablon-0.0.8 test/section_properties_test.rb
sablon-0.0.7 test/section_properties_test.rb