Sha256: d5a63de77cef61a7f15f2a865b1e3fb2c6b8e8565a3eb72a9b15b6aa057c37c7

Contents?: true

Size: 1012 Bytes

Versions: 8

Compression:

Stored size: 1012 Bytes

Contents

require "spec_helper"

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

  it_should_use tag: :docGrid, name: "document_grid"

  for_attribute(:char_space) do
    values = [40960, -12345]
    it_should_assign_and_output_xml values
    it_should_not_allow_invalid_value
    it_should_not_allow_floats
  end

  for_attribute(:line_pitch) do
    values = [40960, -12345]
    it_should_assign_and_output_xml values
    it_should_not_allow_invalid_value
    it_should_not_allow_invalid_value
    it_should_not_allow_floats
  end

  for_attribute(:type) do
    values = %i(default lines linesAndChars snapToChars)
    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(char_space: 40960, line_pitch: 40960, type: :default) do
    it_should_output "<w:docGrid w:charSpace=\"40960\" w:linePitch=\"40960\" w:type=\"default\"/>", assign: false
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

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