Sha256: 513d0ba81e68772d899c3be24f9d60dccc75ee0b2d68d7794be107dbc8c3bde1

Contents?: true

Size: 781 Bytes

Versions: 5

Compression:

Stored size: 781 Bytes

Contents

require "spec_helper"

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

  it_should_use tag: :br, name: "break"

  for_attribute(:clear) do
    %i(all left none right).each do |allowed_value|
      with_value(allowed_value) do
        it_should_assign_successfully
        it_should_output "<w:br w:clear=\"#{allowed_value}\"/>"
      end
    end

    with_value(:somethingElse) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:type) do
    %i(column page textWrapping).each do |allowed_value|
      with_value(allowed_value) do
        it_should_assign_successfully
        it_should_output "<w:br w:type=\"#{allowed_value}\"/>"
      end
    end

    with_value(:somethingElse) do
      it_should_raise_an_exception
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
openxml-docx-0.10.6 spec/elements/break_spec.rb
openxml-docx-0.10.5 spec/elements/break_spec.rb
openxml-docx-0.10.4 spec/elements/break_spec.rb
openxml-docx-0.10.3 spec/elements/break_spec.rb
openxml-docx-0.10.2 spec/elements/break_spec.rb