Sha256: cdcf7f6ce81ee8e9f533a528635c480745df8e3f05b9275a46c1111bb37ae69d
Contents?: true
Size: 1.56 KB
Versions: 2
Compression:
Stored size: 1.56 KB
Contents
require "spec_helper" describe OpenXml::Docx::Section do include ElementTestMacros it_should_have_property :columns it_should_have_property :document_grid it_should_have_property :footer_reference it_should_have_property :header_reference it_should_have_property :line_numbering it_should_have_property :page_margins it_should_have_property :page_borders it_should_have_property :page_numbering it_should_have_property :page_size it_should_have_property :paper_source it_should_have_value_property :bidi it_should_have_value_property :form_protection it_should_have_value_property :rtl_gutter it_should_have_value_property :text_direction, with_value: :lr it_should_have_value_property :type, as_instance_of: :section_type, with_value: :oddPage it_should_have_value_property :vertical_alignment, as_instance_of: :vertical_text_alignment, with_value: :both it_should_have_value_property :title_page it_should_have_value_property :even_and_odd_headers context "if no attribute are set" do before(:each) do @instance = described_class.new end it "should output nothing" do expect(xml(instance)).to eq("") end end context "if there are properties set" do before(:each) do @instance = described_class.new instance.bidi = true instance.columns << OpenXml::Docx::Properties::Column.new(1, 1) end it "should output the correct XML" do expect(xml(instance)).to eq("<w:sectPr>\n <w:cols>\n <w:col w:space=\"1\" w:w=\"1\"/>\n </w:cols>\n <w:bidi/>\n </w:sectPr>") end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
openxml-docx-0.10.5 | spec/section_spec.rb |
openxml-docx-0.10.4 | spec/section_spec.rb |