Sha256: 7468bbf1b332de45ac03bb94a7ec34c06bf91d9ba2050bd67811f34168196d1a

Contents?: true

Size: 959 Bytes

Versions: 8

Compression:

Stored size: 959 Bytes

Contents

require "spec_helper"

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

  context "with an invalid tag provided" do
    it "should raise an exception" do
      expect do
        described_class.new :overthetop
      end.to raise_error(ArgumentError)
    end
  end

  for_attribute(:type) do
    with_value(:dxa) do
      it_should_assign_successfully :bottom
      it_should_output "<w:bottom w:type=\"dxa\"/>", :bottom
    end

    with_value(:pct) do
      it_should_assign_successfully :bottom
      it_should_output "<w:bottom w:type=\"pct\"/>", :bottom
    end

    it_should_not_allow_invalid_value
    it_should_not_allow_integers
  end

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

    it_should_not_allow_negative_numbers
    it_should_not_allow_floats
    it_should_not_allow_invalid_value
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

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