openxml-docx 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. data/Gemfile.lock +1 -1
  2. data/examples/booklet-printing +55 -0
  3. data/lib/openxml/docx/attribute_builder.rb +11 -5
  4. data/lib/openxml/docx/elements/absolute_position_tab.rb +1 -1
  5. data/lib/openxml/docx/elements/background.rb +16 -0
  6. data/lib/openxml/docx/elements/book_fold_printing.rb +1 -1
  7. data/lib/openxml/docx/elements/book_fold_reverse_printing.rb +1 -1
  8. data/lib/openxml/docx/elements/compatibility_setting.rb +10 -0
  9. data/lib/openxml/docx/elements/compatibility_settings.rb +15 -0
  10. data/lib/openxml/docx/elements/embed_bold.rb +2 -10
  11. data/lib/openxml/docx/elements/embed_bold_italic.rb +2 -10
  12. data/lib/openxml/docx/elements/embed_italic.rb +2 -10
  13. data/lib/openxml/docx/elements/embed_regular.rb +3 -3
  14. data/lib/openxml/docx/elements/embed_system_fonts.rb +1 -1
  15. data/lib/openxml/docx/elements/embed_true_type_fonts.rb +1 -1
  16. data/lib/openxml/docx/elements/even_and_odd_headers.rb +11 -0
  17. data/lib/openxml/docx/elements/family.rb +1 -1
  18. data/lib/openxml/docx/elements/markup_compatibility_choice.rb +1 -1
  19. data/lib/openxml/docx/elements/paragraph.rb +1 -0
  20. data/lib/openxml/docx/elements/save_subset_fonts.rb +1 -1
  21. data/lib/openxml/docx/elements/table_cell.rb +1 -0
  22. data/lib/openxml/docx/elements/textbox_content.rb +9 -0
  23. data/lib/openxml/docx/elements/word_processing_drawing_anchor.rb +6 -6
  24. data/lib/openxml/docx/elements/word_processing_drawing_inline.rb +16 -0
  25. data/lib/openxml/docx/elements/word_processing_drawing_object_nv_properties.rb +1 -1
  26. data/lib/openxml/docx/elements/word_processing_drawing_wrap_polygon.rb +1 -1
  27. data/lib/openxml/docx/elements/word_processing_shapes_body_properties.rb +12 -12
  28. data/lib/openxml/docx/elements/word_processing_shapes_nv_drawing_properties.rb +1 -1
  29. data/lib/openxml/docx/elements/word_processing_shapes_shape.rb +1 -2
  30. data/lib/openxml/docx/elements/word_processing_shapes_shape_properties.rb +1 -11
  31. data/lib/openxml/docx/elements/word_processing_shapes_textual_contents.rb +13 -0
  32. data/lib/openxml/{drawingml → docx}/elements/wordprocessing_shape_group.rb +1 -1
  33. data/lib/openxml/docx/package.rb +4 -3
  34. data/lib/openxml/docx/parts/document.rb +5 -0
  35. data/lib/openxml/docx/parts/header.rb +1 -1
  36. data/lib/openxml/docx/properties.rb +1 -0
  37. data/lib/openxml/docx/properties/border.rb +2 -2
  38. data/lib/openxml/docx/properties/columns.rb +8 -2
  39. data/lib/openxml/docx/properties/conditional_formatting.rb +12 -12
  40. data/lib/openxml/docx/properties/container_property.rb +10 -10
  41. data/lib/openxml/docx/properties/footer_references.rb +12 -0
  42. data/lib/openxml/docx/properties/frame.rb +1 -1
  43. data/lib/openxml/docx/properties/header_references.rb +12 -0
  44. data/lib/openxml/docx/properties/indentation.rb +5 -1
  45. data/lib/openxml/docx/properties/latent_styles.rb +4 -4
  46. data/lib/openxml/docx/properties/latent_styles_exception.rb +4 -4
  47. data/lib/openxml/docx/properties/section.rb +15 -0
  48. data/lib/openxml/docx/properties/table_border.rb +2 -2
  49. data/lib/openxml/docx/properties/table_cell_border.rb +2 -2
  50. data/lib/openxml/docx/properties/table_look.rb +7 -6
  51. data/lib/openxml/docx/properties/text_direction.rb +1 -1
  52. data/lib/openxml/docx/properties/transparent_container_property.rb +14 -0
  53. data/lib/openxml/docx/properties/vertical_merge.rb +14 -0
  54. data/lib/openxml/docx/section.rb +2 -0
  55. data/lib/openxml/docx/style.rb +18 -6
  56. data/lib/openxml/docx/version.rb +1 -1
  57. data/lib/openxml/drawingml/elements/blip_fill.rb +1 -1
  58. data/lib/openxml/drawingml/elements/children_extents.rb +14 -0
  59. data/lib/openxml/drawingml/elements/children_offset.rb +14 -0
  60. data/lib/openxml/drawingml/elements/graphic_frame_locks.rb +6 -6
  61. data/lib/openxml/drawingml/elements/no_autofit.rb +10 -0
  62. data/lib/openxml/drawingml/elements/no_fill.rb +1 -1
  63. data/lib/openxml/drawingml/elements/non_visual_drawing_properties.rb +1 -1
  64. data/lib/openxml/drawingml/elements/non_visual_picture_drawing_properties.rb +1 -1
  65. data/lib/openxml/drawingml/elements/non_visual_shape_drawing_properties.rb +12 -0
  66. data/lib/openxml/drawingml/elements/picture_locks.rb +11 -11
  67. data/lib/openxml/drawingml/elements/preset_text_warp.rb +25 -0
  68. data/lib/openxml/vml/elements/group.rb +17 -37
  69. data/lib/openxml/vml/elements/rectangle.rb +29 -62
  70. data/lib/openxml/vml/elements/rounded_rectangle.rb +29 -61
  71. data/spec/elements/absolute_position_tab_spec.rb +21 -15
  72. data/spec/elements/background_spec.rb +52 -0
  73. data/spec/elements/bidi_embed_spec.rb +12 -4
  74. data/spec/elements/bidi_override_spec.rb +12 -4
  75. data/spec/elements/break_spec.rb +12 -10
  76. data/spec/elements/compatibility_setting_spec.rb +41 -0
  77. data/spec/elements/compatibility_settings_spec.rb +8 -0
  78. data/spec/elements/content_part_spec.rb +2 -2
  79. data/spec/elements/control_spec.rb +5 -5
  80. data/spec/elements/deleted_text_spec.rb +2 -2
  81. data/spec/elements/drawingml/blip_fill_spec.rb +8 -3
  82. data/spec/elements/drawingml/extents_spec.rb +4 -4
  83. data/spec/elements/drawingml/head_end_spec.rb +16 -13
  84. data/spec/elements/drawingml/no_autofit_spec.rb +8 -0
  85. data/spec/elements/drawingml/non_visual_drawing_properties_spec.rb +6 -6
  86. data/spec/elements/drawingml/non_visual_shape_drawing_properties_spec.rb +24 -0
  87. data/spec/elements/drawingml/offset_spec.rb +14 -4
  88. data/spec/elements/drawingml/outline_spec.rb +20 -14
  89. data/spec/elements/drawingml/preset_geometry_spec.rb +1 -1
  90. data/spec/elements/drawingml/preset_text_warp_spec.rb +36 -0
  91. data/spec/elements/drawingml/shape_guide_spec.rb +7 -3
  92. data/spec/elements/drawingml/srgb_color_spec.rb +3 -4
  93. data/spec/elements/drawingml/tail_end_spec.rb +17 -14
  94. data/spec/elements/drawingml/transform_effect_spec.rb +48 -26
  95. data/spec/elements/markup_compatibility_choice_spec.rb +2 -2
  96. data/spec/elements/paragraph_spec.rb +25 -0
  97. data/spec/elements/symbol_spec.rb +4 -4
  98. data/spec/elements/text_spec.rb +1 -1
  99. data/spec/elements/textbox_content_spec.rb +8 -0
  100. data/spec/elements/vml/group_spec.rb +367 -375
  101. data/spec/elements/vml/rectangle_spec.rb +503 -513
  102. data/spec/elements/vml/rounded_rectangle_spec.rb +591 -463
  103. data/spec/elements/word_processing_drawing_effect_extent_spec.rb +32 -12
  104. data/spec/elements/word_processing_drawing_extent_spec.rb +4 -4
  105. data/spec/elements/word_processing_drawing_object_nv_properties_spec.rb +6 -6
  106. data/spec/elements/word_processing_drawing_simple_position_spec.rb +16 -6
  107. data/spec/elements/word_processing_shapes_body_properties_spec.rb +53 -44
  108. data/spec/elements/word_processing_shapes_shape_properties_spec.rb +6 -5
  109. data/spec/elements/word_processing_shapes_shape_spec.rb +2 -2
  110. data/spec/elements/word_processing_shapes_textual_content_spec.rb +23 -0
  111. data/spec/elements/{drawingml/wordprocessing_shape_group_spec.rb → wordprocessing_shape_group_spec.rb} +1 -1
  112. data/spec/properties/indentation_spec.rb +28 -0
  113. data/spec/properties/table_look_spec.rb +5 -0
  114. data/spec/properties/text_direction_spec.rb +5 -0
  115. data/spec/properties/vertical_merge_spec.rb +22 -0
  116. data/spec/support/data/elements/paragraph_with_section_properties_element.xml +12 -0
  117. data/spec/support/data/parts/empty_header_part.xml +1 -1
  118. data/spec/support/data/parts/header_with_children_part.xml +1 -1
  119. metadata +76 -27
  120. checksums.yaml +0 -7
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ describe OpenXml::DrawingML::Elements::NonVisualShapeDrawingProperties do
4
+ include ElementTestMacros
5
+
6
+ it_should_use tag: :cNvSpPr, name: "non_visual_shape_drawing_properties"
7
+
8
+ for_attribute(:textbox) do
9
+ with_value(true) do
10
+ it_should_assign_successfully
11
+ it_should_output "<wps:cNvSpPr txBox=\"true\"/>"
12
+ end
13
+
14
+ with_value(false) do
15
+ it_should_assign_successfully
16
+ it_should_output "<wps:cNvSpPr txBox=\"false\"/>"
17
+ end
18
+
19
+ with_value(:not_a_boolean) do
20
+ it_should_raise_an_exception
21
+ end
22
+ end
23
+
24
+ end
@@ -8,9 +8,14 @@ describe OpenXml::DrawingML::Elements::Offset do
8
8
  attributes = %i(x y)
9
9
 
10
10
  for_attribute(:x) do
11
- with_values([1, -1]) do
11
+ with_value(1) do
12
12
  it_should_assign_successfully
13
- it_should_output_regular_xml
13
+ it_should_output "<a:off x=\"1\"/>"
14
+ end
15
+
16
+ with_value(-1) do
17
+ it_should_assign_successfully
18
+ it_should_output "<a:off x=\"-1\"/>"
14
19
  end
15
20
 
16
21
  with_values([1.1, :not_a_number]) do
@@ -19,9 +24,14 @@ describe OpenXml::DrawingML::Elements::Offset do
19
24
  end
20
25
 
21
26
  for_attribute(:y) do
22
- with_values([1, -1]) do
27
+ with_value(1) do
28
+ it_should_assign_successfully
29
+ it_should_output "<a:off y=\"1\"/>"
30
+ end
31
+
32
+ with_value(-1) do
23
33
  it_should_assign_successfully
24
- it_should_output_regular_xml
34
+ it_should_output "<a:off y=\"-1\"/>"
25
35
  end
26
36
 
27
37
  with_values([1.1, :not_a_number]) do
@@ -5,11 +5,15 @@ describe OpenXml::DrawingML::Elements::Outline do
5
5
 
6
6
  it_should_use tag: :ln, name: "outline"
7
7
 
8
- for_attribute(:alignment, displays_as: :algn) do
9
- allowed = %i(ctr in)
10
- with_values(allowed) do
8
+ for_attribute(:alignment) do
9
+ with_value(:ctr) do
11
10
  it_should_assign_successfully
12
- it_should_output_regular_xml
11
+ it_should_output "<a:ln algn=\"ctr\"/>"
12
+ end
13
+
14
+ with_value(:in) do
15
+ it_should_assign_successfully
16
+ it_should_output "<a:ln algn=\"in\"/>"
13
17
  end
14
18
 
15
19
  with_value(:not_ok) do
@@ -18,10 +22,11 @@ describe OpenXml::DrawingML::Elements::Outline do
18
22
  end
19
23
 
20
24
  for_attribute(:cap) do
21
- allowed = %i(flat rnd sq)
22
- with_values(allowed) do
23
- it_should_assign_successfully
24
- it_should_output_regular_xml
25
+ %i(flat rnd sq).each do |allowed_value|
26
+ with_value(allowed_value) do
27
+ it_should_assign_successfully
28
+ it_should_output "<a:ln cap=\"#{allowed_value}\"/>"
29
+ end
25
30
  end
26
31
 
27
32
  with_value(:not_ok) do
@@ -29,11 +34,12 @@ describe OpenXml::DrawingML::Elements::Outline do
29
34
  end
30
35
  end
31
36
 
32
- for_attribute(:compound_type, displays_as: :cmpd) do
33
- allowed = %i(dbl sng thickThin thinThick tri)
34
- with_values(allowed) do
35
- it_should_assign_successfully
36
- it_should_output_regular_xml
37
+ for_attribute(:compound_type) do
38
+ %i(dbl sng thickThin thinThick tri).each do |allowed_value|
39
+ with_value(allowed_value) do
40
+ it_should_assign_successfully
41
+ it_should_output "<a:ln cmpd=\"#{allowed_value}\"/>"
42
+ end
37
43
  end
38
44
 
39
45
  with_value(:not_ok) do
@@ -44,7 +50,7 @@ describe OpenXml::DrawingML::Elements::Outline do
44
50
  for_attribute(:width, displays_as: :w) do
45
51
  with_value(1) do
46
52
  it_should_assign_successfully
47
- it_should_output_regular_xml
53
+ it_should_output "<a:ln w=\"1\"/>"
48
54
  end
49
55
 
50
56
  with_values([1.1, -1]) do
@@ -8,7 +8,7 @@ describe OpenXml::DrawingML::Elements::PresetGeometry do
8
8
  for_attribute(:preset, displays_as: :prst) do
9
9
  with_value(:roundRect) do
10
10
  it_should_assign_successfully
11
- it_should_output_regular_xml
11
+ it_should_output "<a:prstGeom prst=\"roundRect\"/>"
12
12
  end
13
13
 
14
14
  with_value(:invalidGeometry) do
@@ -0,0 +1,36 @@
1
+ require "spec_helper"
2
+
3
+ describe OpenXml::DrawingML::Elements::PresetTextWarp do
4
+ include ElementTestMacros
5
+ it_should_use tag: :prstTxWarp, name: "preset_text_warp"
6
+
7
+ presets = %i(textArchDown textArchDownPour textArchUp
8
+ textArchUpPour textButton textButtonPour
9
+ textCanDown textCanUp textCascadeDown
10
+ textCascadeUp textChevron textChevronInverted
11
+ textCircle textCirclePour textCurveDown
12
+ textCurveUp textDeflate textDeflateBottom
13
+ textDeflateInflate textDeflateTop
14
+ textDoubleWave1 textFadeDown textFadeLeft
15
+ textFadeRight textFadeUp textInflate
16
+ textInflateBottom textInflateTop textNoShape
17
+ textPlain textRingInside textRingOutside
18
+ textSlantDown textSlantUp textStop textTriangle
19
+ textTriangleInverted textWave1 textWave2
20
+ textWave4)
21
+
22
+ for_attribute(:preset) do
23
+ presets.each do |preset|
24
+ with_value(preset) do
25
+ it_should_assign_successfully
26
+ it_should_output "<a:prstTxWarp prst=\"#{preset}\"/>"
27
+ end
28
+ end
29
+
30
+ with_values([1, false, :incorrect]) do
31
+ it_should_raise_an_exception
32
+ end
33
+
34
+ end
35
+
36
+ end
@@ -23,10 +23,10 @@ describe OpenXml::DrawingML::Elements::ShapeGuide do
23
23
  "tan h w",
24
24
  "val 100" ] # Arguments to formulae can be a variable, a positive integer, or a negative integer
25
25
 
26
- for_attribute(:guide_name, displays_as: :name) do
26
+ for_attribute(:guide_name) do
27
27
  with_value("Some String") do
28
28
  it_should_assign_successfully
29
- it_should_output_regular_xml
29
+ it_should_output "<a:gd name=\"Some String\"/>"
30
30
  end
31
31
 
32
32
  with_values([1, :not_a_string]) do
@@ -37,7 +37,11 @@ describe OpenXml::DrawingML::Elements::ShapeGuide do
37
37
  for_attribute(:formula, displays_as: :fmla) do
38
38
  with_values(formulae) do
39
39
  it_should_assign_successfully
40
- it_should_output_regular_xml
40
+ end
41
+
42
+ with_value("*/ h 10 -100") do
43
+ it_should_assign_successfully
44
+ it_should_output "<a:gd fmla=\"*/ h 10 -100\"/>"
41
45
  end
42
46
 
43
47
  not_allowed = ["a^2 + b^2 = c^2", "Not a formula", 2 ]
@@ -5,14 +5,13 @@ describe OpenXml::DrawingML::Elements::SRGBColor do
5
5
 
6
6
  it_should_use tag: :srgbClr, name: "srgb_color"
7
7
 
8
- for_attribute(:value, displays_as: :val) do
8
+ for_attribute(:value) do
9
9
  with_value("FFFFFF") do
10
10
  it_should_assign_successfully
11
- it_should_output_regular_xml
11
+ it_should_output "<a:srgbClr val=\"FFFFFF\"/>"
12
12
  end
13
13
 
14
- not_allowed = ["blue", :blue, 23]
15
- with_values(not_allowed) do
14
+ with_values(["blue", :blue, 23]) do
16
15
  it_should_raise_an_exception
17
16
  end
18
17
  end
@@ -5,11 +5,12 @@ describe OpenXml::DrawingML::Elements::TailEnd do
5
5
 
6
6
  it_should_use tag: :tailEnd, name: "tail_end"
7
7
 
8
- for_attribute(:length, displays_as: :len) do
9
- allowed = %i(lg med sm)
10
- with_values(allowed) do
11
- it_should_assign_successfully
12
- it_should_output_regular_xml
8
+ for_attribute(:length) do
9
+ %i(lg med sm).each do |allowed_value|
10
+ with_value(allowed_value) do
11
+ it_should_assign_successfully
12
+ it_should_output "<a:tailEnd len=\"#{allowed_value}\"/>"
13
+ end
13
14
  end
14
15
 
15
16
  with_value(:bad_value) do
@@ -18,10 +19,11 @@ describe OpenXml::DrawingML::Elements::TailEnd do
18
19
  end
19
20
 
20
21
  for_attribute(:type) do
21
- allowed = %i(arrow diamond none oval stealth triangle)
22
- with_values(allowed) do
23
- it_should_assign_successfully
24
- it_should_output_regular_xml
22
+ %i(arrow diamond none oval stealth triangle).each do |allowed_value|
23
+ with_value(allowed_value) do
24
+ it_should_assign_successfully
25
+ it_should_output "<a:tailEnd type=\"#{allowed_value}\"/>"
26
+ end
25
27
  end
26
28
 
27
29
  with_value(:bad_value) do
@@ -29,11 +31,12 @@ describe OpenXml::DrawingML::Elements::TailEnd do
29
31
  end
30
32
  end
31
33
 
32
- for_attribute(:width, displays_as: :w) do
33
- allowed = %i(lg med sm)
34
- with_values(allowed) do
35
- it_should_assign_successfully
36
- it_should_output_regular_xml
34
+ for_attribute(:width) do
35
+ %i(lg med sm).each do |allowed_value|
36
+ with_value(allowed_value) do
37
+ it_should_assign_successfully
38
+ it_should_output "<a:tailEnd w=\"#{allowed_value}\"/>"
39
+ end
37
40
  end
38
41
 
39
42
  with_value(:bad_value) do
@@ -5,55 +5,76 @@ describe OpenXml::DrawingML::Elements::TransformEffect do
5
5
 
6
6
  it_should_use tag: :xfrm, name: "transform_effect"
7
7
 
8
- for_attribute(:horizontal_skew, displays_as: :kx) do
9
- with_values([1, -1]) do
8
+ for_attribute(:horizontal_skew) do
9
+ with_value(1) do
10
10
  it_should_assign_successfully
11
- it_should_output_regular_xml
11
+ it_should_output "<a:xfrm kx=\"1\"/>"
12
12
  end
13
13
 
14
- with_value(:not_a_number) do
14
+ with_value(-1) do
15
+ it_should_assign_successfully
16
+ it_should_output "<a:xfrm kx=\"-1\"/>"
17
+ end
18
+
19
+ with_value([:not_a_number, 12.34]) do
15
20
  it_should_raise_an_exception
16
21
  end
17
22
  end
18
23
 
19
- for_attribute(:vertical_skew, displays_as: :ky) do
20
- with_values([1, -1]) do
24
+ for_attribute(:vertical_skew) do
25
+ with_value(1) do
21
26
  it_should_assign_successfully
22
- it_should_output_regular_xml
27
+ it_should_output "<a:xfrm ky=\"1\"/>"
23
28
  end
24
29
 
25
- with_value(:not_a_number) do
30
+ with_value(-1) do
31
+ it_should_assign_successfully
32
+ it_should_output "<a:xfrm ky=\"-1\"/>"
33
+ end
34
+
35
+ with_value([:not_a_number, 12.34]) do
26
36
  it_should_raise_an_exception
27
37
  end
28
38
  end
29
39
 
30
- for_attribute(:horizontal_shift, displays_as: :tx) do
31
- with_values([1, -1]) do
40
+ for_attribute(:horizontal_shift) do
41
+ with_value(1) do
42
+ it_should_assign_successfully
43
+ it_should_output "<a:xfrm tx=\"1\"/>"
44
+ end
45
+
46
+ with_value(-1) do
32
47
  it_should_assign_successfully
33
- it_should_output_regular_xml
48
+ it_should_output "<a:xfrm tx=\"-1\"/>"
34
49
  end
35
50
 
36
- with_value(:not_a_number) do
51
+ with_value([:not_a_number, 12.34]) do
37
52
  it_should_raise_an_exception
38
53
  end
39
54
  end
40
55
 
41
- for_attribute(:vertical_shift, displays_as: :ty) do
42
- with_values([1, -1]) do
56
+ for_attribute(:vertical_shift) do
57
+ with_value(1) do
43
58
  it_should_assign_successfully
44
- it_should_output_regular_xml
59
+ it_should_output "<a:xfrm ty=\"1\"/>"
45
60
  end
46
61
 
47
- with_value(:not_a_number) do
62
+ with_value(-1) do
63
+ it_should_assign_successfully
64
+ it_should_output "<a:xfrm ty=\"-1\"/>"
65
+ end
66
+
67
+ with_value([:not_a_number, 12.34]) do
48
68
  it_should_raise_an_exception
49
69
  end
50
70
  end
51
71
 
52
- for_attribute(:horizontal_ratio, displays_as: :sx) do
53
- allowed = %w(1% -1% 1.1%)
54
- with_values(allowed) do
55
- it_should_assign_successfully
56
- it_should_output_regular_xml
72
+ for_attribute(:horizontal_ratio) do
73
+ %w(1% -1% 1.1%).each do |allowed_value|
74
+ with_value(allowed_value) do
75
+ it_should_assign_successfully
76
+ it_should_output "<a:xfrm sx=\"#{allowed_value}\"/>"
77
+ end
57
78
  end
58
79
 
59
80
  with_values(["1", 1]) do
@@ -61,11 +82,12 @@ describe OpenXml::DrawingML::Elements::TransformEffect do
61
82
  end
62
83
  end
63
84
 
64
- for_attribute(:vertical_ratio, displays_as: :sy) do
65
- allowed = %w(1% -1% 1.1%)
66
- with_values(allowed) do
67
- it_should_assign_successfully
68
- it_should_output_regular_xml
85
+ for_attribute(:vertical_ratio) do
86
+ %w(1% -1% 1.1%).each do |allowed_value|
87
+ with_value(allowed_value) do
88
+ it_should_assign_successfully
89
+ it_should_output "<a:xfrm sy=\"#{allowed_value}\"/>"
90
+ end
69
91
  end
70
92
 
71
93
  with_values(["1", 1]) do
@@ -9,10 +9,10 @@ describe OpenXml::Docx::Elements::MarkupCompatibilityChoice do
9
9
  it_should_output "<mc:Choice/>", assign: false
10
10
  end
11
11
 
12
- for_attribute(:Required) do
12
+ for_attribute(:requires) do
13
13
  with_value("wps") do
14
14
  it_should_assign_successfully
15
- it_should_output_regular_xml
15
+ it_should_output "<mc:Choice Requires=\"wps\"/>"
16
16
  end
17
17
 
18
18
  with_value(1234) do
@@ -30,4 +30,29 @@ describe OpenXml::Docx::Elements::Paragraph do
30
30
  it_should_output_correct_xml
31
31
  end
32
32
 
33
+ context "with section properties" do
34
+ before(:each) do
35
+ @instance = described_class.new
36
+ ps = OpenXml::Docx::Properties::PageSize.new
37
+ ps.height = 15840
38
+ ps.width = 12240
39
+ @instance.section << ps
40
+
41
+ pm = OpenXml::Docx::Properties::PageMargins.new
42
+ pm.bottom = 1440
43
+ pm.footer = 720
44
+ pm.header = 720
45
+ pm.left = 1440
46
+ pm.right = 1440
47
+ pm.top = 1440
48
+
49
+ @instance.section << pm
50
+ columns = OpenXml::Docx::Properties::Columns.new
51
+ columns.space = 720
52
+ @instance.section << columns
53
+
54
+ end
55
+
56
+ it_should_output_correct_xml node_xml: "paragraph_with_section_properties"
57
+ end
33
58
  end
@@ -5,10 +5,10 @@ describe OpenXml::Docx::Elements::Symbol do
5
5
 
6
6
  it_should_use tag: :sym, name: "symbol"
7
7
 
8
- for_attribute(:font, with_namespace: :w) do
8
+ for_attribute(:font) do
9
9
  with_value("Wingdings") do
10
10
  it_should_assign_successfully
11
- it_should_output_regular_xml
11
+ it_should_output "<w:sym w:font=\"Wingdings\"/>"
12
12
  end
13
13
 
14
14
  with_value(123) do
@@ -16,10 +16,10 @@ describe OpenXml::Docx::Elements::Symbol do
16
16
  end
17
17
  end
18
18
 
19
- for_attribute(:character, with_namespace: :w, displays_as: :char) do
19
+ for_attribute(:character) do
20
20
  with_value("43FD") do
21
21
  it_should_assign_successfully
22
- it_should_output_regular_xml
22
+ it_should_output "<w:sym w:char=\"43FD\"/>"
23
23
  end
24
24
 
25
25
  with_value("43gg") do