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
@@ -10,10 +10,15 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingEffectExtent do
10
10
  end
11
11
 
12
12
 
13
- for_attribute(:bottom_edge, displays_as: :b) do
14
- with_values([1234, -1234])do
13
+ for_attribute(:bottom_edge) do
14
+ with_value(1234)do
15
15
  it_should_assign_successfully
16
- it_should_output_regular_xml
16
+ it_should_output "<wp:effectExtent b=\"1234\"/>"
17
+ end
18
+
19
+ with_value(-1234)do
20
+ it_should_assign_successfully
21
+ it_should_output "<wp:effectExtent b=\"-1234\"/>"
17
22
  end
18
23
 
19
24
  with_value("wrong") do
@@ -21,10 +26,15 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingEffectExtent do
21
26
  end
22
27
  end
23
28
 
24
- for_attribute(:left_edge, displays_as: :l) do
25
- with_values([1234, -1234])do
29
+ for_attribute(:left_edge) do
30
+ with_value(1234)do
31
+ it_should_assign_successfully
32
+ it_should_output "<wp:effectExtent l=\"1234\"/>"
33
+ end
34
+
35
+ with_value(-1234)do
26
36
  it_should_assign_successfully
27
- it_should_output_regular_xml
37
+ it_should_output "<wp:effectExtent l=\"-1234\"/>"
28
38
  end
29
39
 
30
40
  with_value("wrong") do
@@ -32,10 +42,15 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingEffectExtent do
32
42
  end
33
43
  end
34
44
 
35
- for_attribute(:right_edge, displays_as: :r) do
36
- with_value([1234, -1234])do
45
+ for_attribute(:right_edge) do
46
+ with_value(1234)do
37
47
  it_should_assign_successfully
38
- it_should_output_regular_xml
48
+ it_should_output "<wp:effectExtent r=\"1234\"/>"
49
+ end
50
+
51
+ with_value(-1234)do
52
+ it_should_assign_successfully
53
+ it_should_output "<wp:effectExtent r=\"-1234\"/>"
39
54
  end
40
55
 
41
56
  with_value("wrong") do
@@ -43,10 +58,15 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingEffectExtent do
43
58
  end
44
59
  end
45
60
 
46
- for_attribute(:top_edge, displays_as: :t) do
47
- with_value([1234, -1234])do
61
+ for_attribute(:top_edge) do
62
+ with_value(1234)do
63
+ it_should_assign_successfully
64
+ it_should_output "<wp:effectExtent t=\"1234\"/>"
65
+ end
66
+
67
+ with_value(-1234)do
48
68
  it_should_assign_successfully
49
- it_should_output_regular_xml
69
+ it_should_output "<wp:effectExtent t=\"-1234\"/>"
50
70
  end
51
71
 
52
72
  with_value("wrong") do
@@ -9,10 +9,10 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingExtent do
9
9
  it_should_output "<wp:extent/>", assign: false
10
10
  end
11
11
 
12
- for_attribute(:extent_length, displays_as: :cx) do
12
+ for_attribute(:extent_length) do
13
13
  with_value(1234)do
14
14
  it_should_assign_successfully
15
- it_should_output_regular_xml
15
+ it_should_output "<wp:extent cx=\"1234\"/>"
16
16
  end
17
17
 
18
18
  with_value(-1234) do
@@ -20,10 +20,10 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingExtent do
20
20
  end
21
21
  end
22
22
 
23
- for_attribute(:extent_width, displays_as: :cy) do
23
+ for_attribute(:extent_width) do
24
24
  with_value(1234)do
25
25
  it_should_assign_successfully
26
- it_should_output_regular_xml
26
+ it_should_output "<wp:extent cy=\"1234\"/>"
27
27
  end
28
28
 
29
29
  with_value(-1234) do
@@ -9,10 +9,10 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingObjectNvProperties do
9
9
  it_should_output "<wp:docPr/>", assign: false
10
10
  end
11
11
 
12
- for_attribute(:description, displays_as: :descr) do
12
+ for_attribute(:description) do
13
13
  with_value("valid value")do
14
14
  it_should_assign_successfully
15
- it_should_output_regular_xml
15
+ it_should_output "<wp:docPr descr=\"valid value\"/>"
16
16
  end
17
17
 
18
18
  with_value(1234) do
@@ -23,7 +23,7 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingObjectNvProperties do
23
23
  for_attribute(:hidden) do
24
24
  with_value(true)do
25
25
  it_should_assign_successfully
26
- it_should_output_regular_xml
26
+ it_should_output "<wp:docPr hidden=\"true\"/>"
27
27
  end
28
28
 
29
29
  with_value(1234) do
@@ -34,7 +34,7 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingObjectNvProperties do
34
34
  for_attribute(:id) do
35
35
  with_value(1)do
36
36
  it_should_assign_successfully
37
- it_should_output_regular_xml
37
+ it_should_output "<wp:docPr id=\"1\"/>"
38
38
  end
39
39
 
40
40
  with_value("invalid") do
@@ -45,7 +45,7 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingObjectNvProperties do
45
45
  for_attribute(:object_name, displays_as: :name) do
46
46
  with_value("valid")do
47
47
  it_should_assign_successfully
48
- it_should_output_regular_xml
48
+ it_should_output "<wp:docPr name=\"valid\"/>"
49
49
  end
50
50
 
51
51
  with_value(1234) do
@@ -56,7 +56,7 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingObjectNvProperties do
56
56
  for_attribute(:title) do
57
57
  with_value("valid")do
58
58
  it_should_assign_successfully
59
- it_should_output_regular_xml
59
+ it_should_output "<wp:docPr title=\"valid\"/>"
60
60
  end
61
61
 
62
62
  with_value(1234) do
@@ -10,23 +10,33 @@ describe OpenXml::Docx::Elements::WordProcessingDrawingSimplePosition do
10
10
  end
11
11
 
12
12
  for_attribute(:x) do
13
- with_value([1234, -1234])do
13
+ with_value(1234)do
14
14
  it_should_assign_successfully
15
- it_should_output_regular_xml
15
+ it_should_output "<wp:simplePos x=\"1234\"/>"
16
16
  end
17
17
 
18
- with_value("hey") do
18
+ with_value(-1234)do
19
+ it_should_assign_successfully
20
+ it_should_output "<wp:simplePos x=\"-1234\"/>"
21
+ end
22
+
23
+ with_values([12.34, "not a number"]) do
19
24
  it_should_raise_an_exception
20
25
  end
21
26
  end
22
27
 
23
28
  for_attribute(:y) do
24
- with_value([1234, -1234])do
29
+ with_value(1234)do
30
+ it_should_assign_successfully
31
+ it_should_output "<wp:simplePos y=\"1234\"/>"
32
+ end
33
+
34
+ with_value(-1234)do
25
35
  it_should_assign_successfully
26
- it_should_output_regular_xml
36
+ it_should_output "<wp:simplePos y=\"-1234\"/>"
27
37
  end
28
38
 
29
- with_value("hey") do
39
+ with_values([12.34, "not a number"]) do
30
40
  it_should_raise_an_exception
31
41
  end
32
42
  end
@@ -6,10 +6,11 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
6
6
  it_should_use tag: :bodyPr, name: "word_processing_shapes_body_properties"
7
7
 
8
8
  for_attribute(:anchor)do
9
- allowed = %i(b ctr dist just t)
10
- with_values(allowed) do
11
- it_should_assign_successfully
12
- it_should_output_regular_xml
9
+ %i(b ctr dist just t).each do |allowed|
10
+ with_value(allowed) do
11
+ it_should_assign_successfully
12
+ it_should_output "<wps:bodyPr anchor=\"#{allowed}\"/>"
13
+ end
13
14
  end
14
15
 
15
16
  with_value(:notRight) do
@@ -17,10 +18,10 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
17
18
  end
18
19
  end
19
20
 
20
- for_attribute(:anchorCtr)do
21
+ for_attribute(:anchor_center, displays_as: :anchorCtr)do
21
22
  with_value(true) do
22
23
  it_should_assign_successfully
23
- it_should_output_regular_xml
24
+ it_should_output "<wps:bodyPr anchorCtr=\"true\"/>"
24
25
  end
25
26
 
26
27
  with_value(1234) do
@@ -31,7 +32,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
31
32
  for_attribute(:bottom_inset, displays_as: :bIns)do
32
33
  with_value(1234) do
33
34
  it_should_assign_successfully
34
- it_should_output_regular_xml
35
+ it_should_output "<wps:bodyPr bIns=\"1234\"/>"
35
36
  end
36
37
 
37
38
  with_value(-1234) do
@@ -42,7 +43,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
42
43
  for_attribute(:compatible_line_spacing, displays_as: :compatLnSpc)do
43
44
  with_value(true) do
44
45
  it_should_assign_successfully
45
- it_should_output_regular_xml
46
+ it_should_output "<wps:bodyPr compatLnSpc=\"true\"/>"
46
47
  end
47
48
 
48
49
  with_value(1234) do
@@ -53,7 +54,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
53
54
  for_attribute(:force_anti_alias, displays_as: :forceAA)do
54
55
  with_value(true) do
55
56
  it_should_assign_successfully
56
- it_should_output_regular_xml
57
+ it_should_output "<wps:bodyPr forceAA=\"true\"/>"
57
58
  end
58
59
 
59
60
  with_value(1234) do
@@ -61,10 +62,10 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
61
62
  end
62
63
  end
63
64
 
64
- for_attribute(:fromWordArt)do
65
+ for_attribute(:from_word_art, displays_as: :fromWordArt)do
65
66
  with_value(true) do
66
67
  it_should_assign_successfully
67
- it_should_output_regular_xml
68
+ it_should_output "<wps:bodyPr fromWordArt=\"true\"/>"
68
69
  end
69
70
 
70
71
  with_value(1234) do
@@ -72,11 +73,12 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
72
73
  end
73
74
  end
74
75
 
75
- for_attribute(:horzOverflow)do
76
- allowed = %i(clip overflow)
77
- with_values(allowed) do
78
- it_should_assign_successfully
79
- it_should_output_regular_xml
76
+ for_attribute(:horizontal_overflow, displays_as: :horzOverflow)do
77
+ %i(clip overflow).each do |allowed|
78
+ with_value(allowed) do
79
+ it_should_assign_successfully
80
+ it_should_output "<wps:bodyPr horzOverflow=\"#{allowed}\"/>"
81
+ end
80
82
  end
81
83
 
82
84
  with_value(:notRight) do
@@ -87,7 +89,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
87
89
  for_attribute(:left_inset, displays_as: :lIns)do
88
90
  with_value(1234) do
89
91
  it_should_assign_successfully
90
- it_should_output_regular_xml
92
+ it_should_output "<wps:bodyPr lIns=\"1234\"/>"
91
93
  end
92
94
 
93
95
  with_value(-1234) do
@@ -95,14 +97,13 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
95
97
  end
96
98
  end
97
99
 
98
- for_attribute(:numCol)do
99
- allowed = (1..16).to_a
100
- with_values(allowed) do
100
+ for_attribute(:number_of_columns, displays_as: :numCol)do
101
+ with_value(9) do
101
102
  it_should_assign_successfully
102
- it_should_output_regular_xml
103
+ it_should_output "<wps:bodyPr numCol=\"9\"/>"
103
104
  end
104
105
 
105
- with_value(:notRight) do
106
+ with_value([0, 17, :not_a_number]) do
106
107
  it_should_raise_an_exception
107
108
  end
108
109
  end
@@ -110,7 +111,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
110
111
  for_attribute(:right_inset, displays_as: :rIns)do
111
112
  with_value(1234) do
112
113
  it_should_assign_successfully
113
- it_should_output_regular_xml
114
+ it_should_output "<wps:bodyPr rIns=\"1234\"/>"
114
115
  end
115
116
 
116
117
  with_value(-1234) do
@@ -119,9 +120,14 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
119
120
  end
120
121
 
121
122
  for_attribute(:rotation, displays_as: :rot)do
122
- with_values([1234, -1234]) do
123
+ with_value(1234) do
123
124
  it_should_assign_successfully
124
- it_should_output_regular_xml
125
+ it_should_output "<wps:bodyPr rot=\"1234\"/>"
126
+ end
127
+
128
+ with_value(-1234) do
129
+ it_should_assign_successfully
130
+ it_should_output "<wps:bodyPr rot=\"-1234\"/>"
125
131
  end
126
132
 
127
133
  with_value("not valid") do
@@ -132,7 +138,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
132
138
  for_attribute(:right_to_left_columns, displays_as: :rtlCol)do
133
139
  with_value(true) do
134
140
  it_should_assign_successfully
135
- it_should_output_regular_xml
141
+ it_should_output "<wps:bodyPr rtlCol=\"true\"/>"
136
142
  end
137
143
 
138
144
  with_value(1234) do
@@ -143,7 +149,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
143
149
  for_attribute(:space_between_columns, displays_as: :spcCol)do
144
150
  with_value(1234) do
145
151
  it_should_assign_successfully
146
- it_should_output_regular_xml
152
+ it_should_output "<wps:bodyPr spcCol=\"1234\"/>"
147
153
  end
148
154
 
149
155
  with_value(-1234) do
@@ -154,7 +160,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
154
160
  for_attribute(:paragraph_spacing, displays_as: :spcFirstLastPara)do
155
161
  with_value(true) do
156
162
  it_should_assign_successfully
157
- it_should_output_regular_xml
163
+ it_should_output "<wps:bodyPr spcFirstLastPara=\"true\"/>"
158
164
  end
159
165
 
160
166
  with_value(1234) do
@@ -165,7 +171,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
165
171
  for_attribute(:top_inset, displays_as: :tIns)do
166
172
  with_value(1234) do
167
173
  it_should_assign_successfully
168
- it_should_output_regular_xml
174
+ it_should_output "<wps:bodyPr tIns=\"1234\"/>"
169
175
  end
170
176
 
171
177
  with_value(-1234) do
@@ -176,7 +182,7 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
176
182
  for_attribute(:upright)do
177
183
  with_value(true) do
178
184
  it_should_assign_successfully
179
- it_should_output_regular_xml
185
+ it_should_output "<wps:bodyPr upright=\"true\"/>"
180
186
  end
181
187
 
182
188
  with_value(1234) do
@@ -184,11 +190,12 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
184
190
  end
185
191
  end
186
192
 
187
- for_attribute(:vert)do
188
- allowed = %i(eaVert horz mongolianVert vert vert270 wordArt Vert wordArtVertRtl)
189
- with_values(allowed) do
190
- it_should_assign_successfully
191
- it_should_output_regular_xml
193
+ for_attribute(:vertical, displays_as: :vert)do
194
+ %i(eaVert horz mongolianVert vert vert270 wordArt Vert wordArtVertRtl).each do |allowed|
195
+ with_value(allowed) do
196
+ it_should_assign_successfully
197
+ it_should_output "<wps:bodyPr vert=\"#{allowed}\"/>"
198
+ end
192
199
  end
193
200
 
194
201
  with_value(:notRight) do
@@ -196,11 +203,12 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
196
203
  end
197
204
  end
198
205
 
199
- for_attribute(:vertOverflow)do
200
- allowed = %i(clip ellipsis overflow)
201
- with_values(allowed) do
202
- it_should_assign_successfully
203
- it_should_output_regular_xml
206
+ for_attribute(:vertical_overflow, displays_as: :vertOverflow)do
207
+ %i(clip ellipsis overflow).each do |allowed|
208
+ with_value(allowed) do
209
+ it_should_assign_successfully
210
+ it_should_output "<wps:bodyPr vertOverflow=\"#{allowed}\"/>"
211
+ end
204
212
  end
205
213
 
206
214
  with_value(:notRight) do
@@ -209,10 +217,11 @@ describe OpenXml::Docx::Elements::WordProcessingShapesBodyProperties do
209
217
  end
210
218
 
211
219
  for_attribute(:wrap)do
212
- allowed = %i(none square)
213
- with_values(allowed) do
214
- it_should_assign_successfully
215
- it_should_output_regular_xml
220
+ %i(none square).each do |allowed|
221
+ with_value(allowed) do
222
+ it_should_assign_successfully
223
+ it_should_output "<wps:bodyPr wrap=\"#{allowed}\"/>"
224
+ end
216
225
  end
217
226
 
218
227
  with_value(:notRight) do
@@ -5,11 +5,12 @@ describe OpenXml::Docx::Elements::WordProcessingShapesShapeProperties do
5
5
 
6
6
  it_should_use tag: :spPr, name: "word_processing_shapes_shape_properties"
7
7
 
8
- for_attribute(:bwMode) do
9
- allowed = %i(auto black blackGray blackWhite clr gray grayWhite hidden invGray ltGray white)
10
- with_values(allowed) do
11
- it_should_assign_successfully
12
- it_should_output_regular_xml
8
+ for_attribute(:bw_mode) do
9
+ %i(auto black blackGray blackWhite clr gray grayWhite hidden invGray ltGray white).each do |allowed_value|
10
+ with_value(allowed_value) do
11
+ it_should_assign_successfully
12
+ it_should_output "<wps:spPr bwMode=\"#{allowed_value}\"/>"
13
+ end
13
14
  end
14
15
 
15
16
  with_value(:notRight) do
@@ -9,10 +9,10 @@ describe OpenXml::Docx::Elements::WordProcessingShapesShape do
9
9
  it_should_output "<wps:wsp/>", assign: false
10
10
  end
11
11
 
12
- for_attribute(:normalEastAsianFlow) do
12
+ for_attribute(:normal_east_asian_flow) do
13
13
  with_value(true)do
14
14
  it_should_assign_successfully
15
- it_should_output_regular_xml
15
+ it_should_output "<wps:wsp normalEastAsianFlow=\"true\"/>"
16
16
  end
17
17
 
18
18
  with_value("invalid") do