Sha256: 0edd908a427b26e94d07d1eb3c914293ff12a39927aa429f15a78622d1d8b295

Contents?: true

Size: 1.14 KB

Versions: 2

Compression:

Stored size: 1.14 KB

Contents

require "spec_helper"

describe OpenXml::DrawingML::Elements::Outline do
  include ElementTestMacros

  it_should_use tag: :ln, name: "outline"

  for_attribute(:alignment, displays_as: :algn) do
    allowed = %i(ctr in)
    with_values(allowed) do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value(:not_ok) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:cap) do
    allowed = %i(flat rnd sq)
    with_values(allowed) do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value(:not_ok) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:compound_type, displays_as: :cmpd) do
    allowed = %i(dbl sng thickThin thinThick tri)
    with_values(allowed) do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value(:not_ok) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:width, displays_as: :w) do
    with_value(1) do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_values([1.1, -1]) do
      it_should_raise_an_exception
    end
  end




end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openxml-docx-0.10.1 spec/elements/drawingml/outline_spec.rb
openxml-docx-0.10.0 spec/elements/drawingml/outline_spec.rb