Sha256: 0b94eb01b795d26cd53dfb4a153de13aec9aa202a13d03a57dc64218a6ff7eb2

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

require "spec_helper"

describe OpenXml::Docx::Properties::Color do
  include PropertyTestMacros

  it_should_use tag: :color, name: "color"

  for_attribute(:theme_color) do
    with_value(:hyperlink) do
      it_should_assign_successfully
      it_should_output "<w:color w:themeColor=\"hyperlink\"/>"
    end
  end

  for_attribute(:theme_shade) do
    with_value("BF") do
      it_should_assign_successfully
      it_should_output "<w:color w:themeShade=\"BF\"/>"
    end

    with_value(:dark) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:theme_tint) do
    with_value("BF") do
      it_should_assign_successfully
      it_should_output "<w:color w:themeTint=\"BF\"/>"
    end

    with_value(:pink) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:color) do
    with_value(:D99694) do
      it_should_assign_successfully
      it_should_output "<w:color w:val=\"D99694\"/>"
    end

    with_value(:auto) do
      it_should_assign_successfully
      it_should_output "<w:color w:val=\"auto\"/>"
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openxml-docx-0.8.0 spec/properties/color_spec.rb
openxml-docx-0.8.0.beta1 spec/properties/color_spec.rb