Sha256: 9c10281b7142be2d3e7664569d2031f2f6440196238b3d5377ade6149904ab9b

Contents?: true

Size: 901 Bytes

Versions: 2

Compression:

Stored size: 901 Bytes

Contents

require "spec_helper"

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

  it_should_use tag: :col, name: "column", value: [1, 1]

  for_attribute(:space) do
    with_value(2) do
      it_should_assign_successfully 1, 1
      it_should_output "<w:col w:space=\"2\" w:w=\"1\"/>", 1, 1
    end

    with_value(-1) do
      it_should_raise_an_exception
    end

    with_value(12.1) do
      it_should_raise_an_exception
    end

    with_value(:big) do
      it_should_raise_an_exception
    end
  end

  for_attribute(:width) do
    with_value(2) do
      it_should_assign_successfully 1, 1
      it_should_output "<w:col w:space=\"1\" w:w=\"2\"/>", 1, 1
    end

    with_value(-1) do
      it_should_raise_an_exception
    end

    with_value(12.1) do
      it_should_raise_an_exception
    end

    with_value(:big) do
      it_should_raise_an_exception
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

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