Sha256: 48737cc173fddf40aeee808725c5aa5329357ba1c29d118ffa61beb528b0aefc

Contents?: true

Size: 815 Bytes

Versions: 5

Compression:

Stored size: 815 Bytes

Contents

require "spec_helper"

describe OpenXml::Docx::Elements::Paragraph do
  include ElementTestMacros

  it_should_use tag: :p, name: "paragraph"

  context "with runs" do
    before(:each) do
      @instance = described_class.new
      instance.indentation.start = 720
      instance.indentation.end = -1440
      run = OpenXml::Docx::Elements::Run.new
      run << OpenXml::Docx::Elements::Text.new("Hey Run 1")
      instance << run
      run = OpenXml::Docx::Elements::Run.new
      run << OpenXml::Docx::Elements::Text.new("Hey Run 2")
      instance << run
    end

    it_should_output_correct_xml node_xml: "paragraph_with_runs"
  end

  context "without runs" do
    before(:each) do
      @instance = described_class.new
      instance.alignment = :center
    end

    it_should_output_correct_xml
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
openxml-docx-0.10.1 spec/elements/paragraph_spec.rb
openxml-docx-0.10.0 spec/elements/paragraph_spec.rb
openxml-docx-0.9.0 spec/elements/paragraph_spec.rb
openxml-docx-0.8.0 spec/elements/paragraph_spec.rb
openxml-docx-0.8.0.beta1 spec/elements/paragraph_spec.rb