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