Sha256: dcdaafd0d727db6be99bfc81f057703df0568bf4372e3397e29d728e3fa68b53

Contents?: true

Size: 1.36 KB

Versions: 1

Compression:

Stored size: 1.36 KB

Contents

require "spec_helper"

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

  it_should_use tag: :docPr, name: "word_processing_drawing_object_nv_properties"

  with_no_attributes_set do
    it_should_output "<wp:docPr/>", assign: false
  end

  for_attribute(:description, displays_as: :descr) do
    with_value("valid value")do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value(1234) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:hidden) do
    with_value(true)do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value(1234) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:id) do
    with_value(1)do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value("invalid") do
      it_should_raise_an_exception
    end
  end

  for_attribute(:property_name, displays_as: :name) do
    with_value("valid")do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value(1234) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:title) do
    with_value("valid")do
      it_should_assign_successfully
      it_should_output_regular_xml
    end

    with_value(1234) do
      it_should_raise_an_exception
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openxml-docx-0.10.0 spec/elements/word_processing_drawing_object_nv_properties_spec.rb