Sha256: 6315ef9f3adb0ebf1c8a322b95e3faa8440c027d4cf2bb301e38e3471cf17697

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

require "spec_helper"

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

  it_should_use tag: :u, name: "underline"

  for_attribute(:color) do
    values = ["FF34E1", :auto]
    it_should_assign_and_output_xml values
    it_should_not_allow_invalid_value
  end

  for_attribute(:theme_color) do
    it_should_assign_and_output_xml :accent3
    it_should_not_allow_invalid_value
  end

  for_attribute(:theme_shade) do
    it_should_assign_and_output_xml "BF"
    it_should_not_allow_invalid_value
  end

  for_attribute(:theme_tint) do
    it_should_assign_and_output_xml "BF"
    it_should_not_allow_invalid_value
  end

  for_attribute(:type) do
    values = %i(dash dashDotDotHeavy dashDotDotHeavy dashedHeavy dashLong dashLongHeavy
                dotDash dotDotDash dotted dottedHeavy double none single thick wave
                wavyDouble wavyHeavy words)
    it_should_assign_and_output_xml values
    it_should_not_allow_invalid_value
  end

  with_no_attributes_set do
    it_should_output "", assign: false
  end

  with_these_attributes_set(color: "95B3D7", theme_color: :accent2, theme_tint: "99") do
    it_should_output "<w:u w:color=\"95B3D7\" w:themeColor=\"accent2\" w:themeTint=\"99\"/>", assign: false
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
openxml-docx-0.10.6 spec/properties/underline_spec.rb
openxml-docx-0.10.5 spec/properties/underline_spec.rb
openxml-docx-0.10.4 spec/properties/underline_spec.rb
openxml-docx-0.10.3 spec/properties/underline_spec.rb
openxml-docx-0.10.2 spec/properties/underline_spec.rb
openxml-docx-0.10.1 spec/properties/underline_spec.rb
openxml-docx-0.10.0 spec/properties/underline_spec.rb
openxml-docx-0.9.0 spec/properties/underline_spec.rb