Sha256: e9220a4487cea5a67f90b3028ab2881e80a4d58c33def2de9c9c9bb436f68b72

Contents?: true

Size: 990 Bytes

Versions: 5

Compression:

Stored size: 990 Bytes

Contents

require "spec_helper"

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

  it_should_use tag: :blipFill, name: "blip_fill"

  for_attribute(:dpi) do
    with_value(1) do
      it_should_assign_successfully
      it_should_output "<pic:blipFill dpi=\"1\"/>"
    end

    with_value(-1) do
      it_should_assign_successfully
      it_should_output "<pic:blipFill dpi=\"-1\"/>"
    end

    with_values([:not_a_number, 12.34]) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:rotate_with_shape) do
    with_value(true) do
      it_should_assign_successfully
      it_should_output "<pic:blipFill rotWithShape=\"true\"/>"
    end

    with_value(false) do
      it_should_assign_successfully
      it_should_output "<pic:blipFill rotWithShape=\"false\"/>"
    end

    with_value(:not_a_boolean) do
      it_should_raise_an_exception
    end
  end

  with_no_attributes_set do
    it_should_output "<pic:blipFill/>", assign: false
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

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