openxml-docx 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/{example → examples/base} +1 -1
  4. data/examples/table +68 -0
  5. data/lib/openxml/docx/elements/grid_column.rb +12 -0
  6. data/lib/openxml/docx/elements/table.rb +30 -0
  7. data/lib/openxml/docx/elements/table_cell.rb +26 -0
  8. data/lib/openxml/docx/elements/table_grid.rb +10 -0
  9. data/lib/openxml/docx/elements/table_row.rb +36 -0
  10. data/lib/openxml/docx/package.rb +3 -0
  11. data/lib/openxml/docx/properties.rb +2 -0
  12. data/lib/openxml/docx/properties/base_property.rb +14 -0
  13. data/lib/openxml/docx/properties/cant_split.rb +8 -0
  14. data/lib/openxml/docx/properties/columns.rb +2 -0
  15. data/lib/openxml/docx/properties/grid_after.rb +8 -0
  16. data/lib/openxml/docx/properties/grid_before.rb +8 -0
  17. data/lib/openxml/docx/properties/grid_span.rb +8 -0
  18. data/lib/openxml/docx/properties/header.rb +8 -0
  19. data/lib/openxml/docx/properties/headers.rb +12 -0
  20. data/lib/openxml/docx/properties/hidden.rb +8 -0
  21. data/lib/openxml/docx/properties/hide_mark.rb +8 -0
  22. data/lib/openxml/docx/properties/no_wrap.rb +8 -0
  23. data/lib/openxml/docx/properties/table_border.rb +25 -0
  24. data/lib/openxml/docx/properties/table_borders.rb +13 -0
  25. data/lib/openxml/docx/properties/table_caption.rb +10 -0
  26. data/lib/openxml/docx/properties/table_cell_border.rb +25 -0
  27. data/lib/openxml/docx/properties/table_cell_borders.rb +13 -0
  28. data/lib/openxml/docx/properties/table_cell_cell_margin.rb +13 -0
  29. data/lib/openxml/docx/properties/table_cell_fit_text.rb +9 -0
  30. data/lib/openxml/docx/properties/table_cell_margin.rb +13 -0
  31. data/lib/openxml/docx/properties/table_cell_margins.rb +13 -0
  32. data/lib/openxml/docx/properties/table_cell_spacing.rb +13 -0
  33. data/lib/openxml/docx/properties/table_cell_width.rb +13 -0
  34. data/lib/openxml/docx/properties/table_description.rb +10 -0
  35. data/lib/openxml/docx/properties/table_header.rb +10 -0
  36. data/lib/openxml/docx/properties/table_indent.rb +13 -0
  37. data/lib/openxml/docx/properties/table_layout.rb +14 -0
  38. data/lib/openxml/docx/properties/table_look.rb +17 -0
  39. data/lib/openxml/docx/properties/table_overlap.rb +14 -0
  40. data/lib/openxml/docx/properties/table_p_pr.rb +41 -0
  41. data/lib/openxml/docx/properties/table_style.rb +10 -0
  42. data/lib/openxml/docx/properties/table_width.rb +13 -0
  43. data/lib/openxml/docx/properties/tr_height.rb +19 -0
  44. data/lib/openxml/docx/properties/valign.rb +13 -0
  45. data/lib/openxml/docx/properties/wafter.rb +12 -0
  46. data/lib/openxml/docx/properties/wbefore.rb +12 -0
  47. data/lib/openxml/docx/properties/width_property.rb +17 -0
  48. data/lib/openxml/docx/style.rb +17 -7
  49. data/lib/openxml/docx/version.rb +1 -1
  50. data/spec/elements/grid_column_spec.rb +15 -0
  51. data/spec/elements/table_cell_spec.rb +15 -0
  52. data/spec/elements/table_grid_spec.rb +17 -0
  53. data/spec/elements/table_row_spec.rb +18 -0
  54. data/spec/elements/table_spec.rb +21 -0
  55. data/spec/properties/border_spec.rb +21 -95
  56. data/spec/properties/cant_split_spec.rb +23 -0
  57. data/spec/properties/color_spec.rb +9 -29
  58. data/spec/properties/column_spec.rb +6 -22
  59. data/spec/properties/columns_spec.rb +4 -14
  60. data/spec/properties/conditional_formatting_spec.rb +12 -108
  61. data/spec/properties/document_grid_spec.rb +12 -53
  62. data/spec/properties/east_asian_layout_spec.rb +14 -74
  63. data/spec/properties/font_spec.rb +35 -238
  64. data/spec/properties/frame_spec.rb +48 -285
  65. data/spec/properties/grid_after_spec.rb +26 -0
  66. data/spec/properties/grid_before_spec.rb +26 -0
  67. data/spec/properties/grid_span_spec.rb +24 -0
  68. data/spec/properties/header_spec.rb +17 -0
  69. data/spec/properties/headers_spec.rb +39 -0
  70. data/spec/properties/hidden_spec.rb +23 -0
  71. data/spec/properties/hide_mark_spec.rb +23 -0
  72. data/spec/properties/indentation_spec.rb +32 -136
  73. data/spec/properties/language_spec.rb +3 -12
  74. data/spec/properties/latent_styles_exception_spec.rb +7 -22
  75. data/spec/properties/latent_styles_spec.rb +5 -18
  76. data/spec/properties/line_numbering_spec.rb +15 -68
  77. data/spec/properties/manual_width_spec.rb +8 -33
  78. data/spec/properties/no_wrap_spec.rb +23 -0
  79. data/spec/properties/numbering_spec.rb +4 -13
  80. data/spec/properties/page_margins_spec.rb +28 -114
  81. data/spec/properties/page_numbering_spec.rb +26 -367
  82. data/spec/properties/page_size_spec.rb +15 -62
  83. data/spec/properties/paper_source_spec.rb +8 -34
  84. data/spec/properties/shading_spec.rb +21 -92
  85. data/spec/properties/spacing_spec.rb +27 -119
  86. data/spec/properties/table_border_spec.rb +119 -0
  87. data/spec/properties/table_borders_spec.rb +41 -0
  88. data/spec/properties/table_caption_spec.rb +17 -0
  89. data/spec/properties/table_cell_border_spec.rb +119 -0
  90. data/spec/properties/table_cell_borders_spec.rb +40 -0
  91. data/spec/properties/table_cell_cell_margin_spec.rb +46 -0
  92. data/spec/properties/table_cell_fit_text.rb +23 -0
  93. data/spec/properties/table_cell_margin_spec.rb +40 -0
  94. data/spec/properties/table_cell_margins_spec.rb +46 -0
  95. data/spec/properties/table_cell_spacing_spec.rb +21 -0
  96. data/spec/properties/table_cell_width.rb +21 -0
  97. data/spec/properties/table_description_spec.rb +17 -0
  98. data/spec/properties/table_header_spec.rb +23 -0
  99. data/spec/properties/table_indent_spec.rb +43 -0
  100. data/spec/properties/table_layout_spec.rb +22 -0
  101. data/spec/properties/table_look_spec.rb +38 -0
  102. data/spec/properties/table_overlap_spec.rb +22 -0
  103. data/spec/properties/table_p_pr_spec.rb +68 -0
  104. data/spec/properties/table_row_height.rb +20 -0
  105. data/spec/properties/table_style_spec.rb +17 -0
  106. data/spec/properties/table_width_spec.rb +21 -0
  107. data/spec/properties/underline_spec.rb +14 -130
  108. data/spec/properties/valign_spec.rb +19 -0
  109. data/spec/properties/wafter_spec.rb +21 -0
  110. data/spec/properties/wbefore_spec.rb +21 -0
  111. data/spec/support/data/elements/grid_column_element.xml +4 -0
  112. data/spec/support/data/elements/table_cell_element.xml +8 -0
  113. data/spec/support/data/elements/table_element.xml +18 -0
  114. data/spec/support/data/elements/table_grid_element.xml +6 -0
  115. data/spec/support/data/elements/table_row_element.xml +13 -0
  116. data/spec/support/property_test_macros.rb +61 -0
  117. metadata +86 -3
@@ -6,42 +6,17 @@ describe OpenXml::Docx::Properties::ManualWidth do
6
6
  it_should_use tag: :fitText, name: "manual_width"
7
7
 
8
8
  for_attribute(:id) do
9
- with_value(12) do
10
- it_should_assign_successfully
11
- it_should_output "<w:fitText w:id=\"12\"/>"
12
- end
13
-
14
- with_value(-134) do
15
- it_should_assign_successfully
16
- it_should_output "<w:fitText w:id=\"-134\"/>"
17
- end
18
-
19
- with_value(12.3) do
20
- it_should_raise_an_exception
21
- end
22
-
23
- with_value(:three) do
24
- it_should_raise_an_exception
25
- end
9
+ values = [12, -134]
10
+ it_should_assign_and_output_xml values
11
+ it_should_not_allow_floats
12
+ it_should_not_allow_invalid_value
26
13
  end
27
14
 
28
15
  for_attribute(:width) do
29
- with_value(12) do
30
- it_should_assign_successfully
31
- it_should_output "<w:fitText w:val=\"12\"/>"
32
- end
33
-
34
- with_value(-134) do
35
- it_should_raise_an_exception
36
- end
37
-
38
- with_value(12.3) do
39
- it_should_raise_an_exception
40
- end
41
-
42
- with_value(:three) do
43
- it_should_raise_an_exception
44
- end
16
+ it_should_assign_and_output_xml 12
17
+ it_should_not_allow_negative_numbers
18
+ it_should_not_allow_floats
19
+ it_should_not_allow_invalid_value
45
20
  end
46
21
 
47
22
  with_no_attributes_set do
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+
3
+ describe OpenXml::Docx::Properties::NoWrap do
4
+ include ValuePropertyTestMacros
5
+
6
+ it_should_use tag: :noWrap, name: "no_wrap"
7
+
8
+ with_value(true) do
9
+ it_should_work
10
+ it_should_output "<w:noWrap/>"
11
+ end
12
+
13
+ with_value(false) do
14
+ it_should_work
15
+ it_should_output ""
16
+ end
17
+
18
+ with_value(nil) do
19
+ it_should_work
20
+ it_should_output ""
21
+ end
22
+
23
+ end
@@ -11,13 +11,9 @@ describe OpenXml::Docx::Properties::Numbering do
11
11
  it_should_output "<w:numPr>\n <w:ilvl w:val=\"24\"/>\n </w:numPr>"
12
12
  end
13
13
 
14
- with_value(-24) do
15
- it_should_raise_an_exception
16
- end
14
+ it_should_not_allow_negative_numbers
15
+ it_should_not_allow_invalid_value
17
16
 
18
- with_value(:big) do
19
- it_should_raise_an_exception
20
- end
21
17
  end
22
18
 
23
19
  for_attribute(:id) do
@@ -26,13 +22,8 @@ describe OpenXml::Docx::Properties::Numbering do
26
22
  it_should_output "<w:numPr>\n <w:numId w:val=\"24\"/>\n </w:numPr>"
27
23
  end
28
24
 
29
- with_value(-24) do
30
- it_should_raise_an_exception
31
- end
32
-
33
- with_value(:big) do
34
- it_should_raise_an_exception
35
- end
25
+ it_should_not_allow_negative_numbers
26
+ it_should_not_allow_invalid_value
36
27
  end
37
28
 
38
29
  with_no_attributes_set do
@@ -6,138 +6,52 @@ describe OpenXml::Docx::Properties::PageMargins do
6
6
  it_should_use tag: :pgMar, name: "page_margins"
7
7
 
8
8
  for_attribute(:bottom) do
9
- with_value(1440) do
10
- it_should_assign_successfully
11
- it_should_output "<w:pgMar w:bottom=\"1440\"/>"
12
- end
13
-
14
- with_value(-1440) do
15
- it_should_assign_successfully
16
- it_should_output "<w:pgMar w:bottom=\"-1440\"/>"
17
- end
18
-
19
- with_value(9832.1) do
20
- it_should_raise_an_exception
21
- end
22
-
23
- with_value(:big) do
24
- it_should_raise_an_exception
25
- end
9
+ values = [1440, -1440]
10
+ it_should_assign_and_output_xml values
11
+ it_should_not_allow_floats
12
+ it_should_not_allow_invalid_value
26
13
  end
27
14
 
28
15
  for_attribute(:footer) do
29
- with_value(1440) do
30
- it_should_assign_successfully
31
- it_should_output "<w:pgMar w:footer=\"1440\"/>"
32
- end
33
-
34
- with_value(-1440) do
35
- it_should_raise_an_exception
36
- end
37
-
38
- with_value(9832.1) do
39
- it_should_raise_an_exception
40
- end
41
-
42
- with_value(:big) do
43
- it_should_raise_an_exception
44
- end
16
+ it_should_assign_and_output_xml 1440
17
+ it_should_not_allow_negative_numbers
18
+ it_should_not_allow_floats
19
+ it_should_not_allow_invalid_value
45
20
  end
46
21
 
47
22
  for_attribute(:gutter) do
48
- with_value(1440) do
49
- it_should_assign_successfully
50
- it_should_output "<w:pgMar w:gutter=\"1440\"/>"
51
- end
52
-
53
- with_value(-1440) do
54
- it_should_raise_an_exception
55
- end
56
-
57
- with_value(9832.1) do
58
- it_should_raise_an_exception
59
- end
60
-
61
- with_value(:big) do
62
- it_should_raise_an_exception
63
- end
23
+ it_should_assign_and_output_xml 1440
24
+ it_should_not_allow_negative_numbers
25
+ it_should_not_allow_floats
26
+ it_should_not_allow_invalid_value
64
27
  end
65
28
 
66
29
  for_attribute(:header) do
67
- with_value(1440) do
68
- it_should_assign_successfully
69
- it_should_output "<w:pgMar w:header=\"1440\"/>"
70
- end
71
-
72
- with_value(-1440) do
73
- it_should_raise_an_exception
74
- end
75
-
76
- with_value(9832.1) do
77
- it_should_raise_an_exception
78
- end
79
-
80
- with_value(:big) do
81
- it_should_raise_an_exception
82
- end
30
+ it_should_assign_and_output_xml 1440
31
+ it_should_not_allow_negative_numbers
32
+ it_should_not_allow_floats
33
+ it_should_not_allow_invalid_value
83
34
  end
84
35
 
85
36
  for_attribute(:left) do
86
- with_value(1440) do
87
- it_should_assign_successfully
88
- it_should_output "<w:pgMar w:left=\"1440\"/>"
89
- end
90
-
91
- with_value(-1440) do
92
- it_should_raise_an_exception
93
- end
94
-
95
- with_value(9832.1) do
96
- it_should_raise_an_exception
97
- end
98
-
99
- with_value(:big) do
100
- it_should_raise_an_exception
101
- end
37
+ it_should_assign_and_output_xml 1440
38
+ it_should_not_allow_negative_numbers
39
+ it_should_not_allow_floats
40
+ it_should_not_allow_invalid_value
102
41
  end
103
42
 
104
43
  for_attribute(:right) do
105
- with_value(1440) do
106
- it_should_assign_successfully
107
- it_should_output "<w:pgMar w:right=\"1440\"/>"
108
- end
109
-
110
- with_value(-1440) do
111
- it_should_raise_an_exception
112
- end
113
-
114
- with_value(9832.1) do
115
- it_should_raise_an_exception
116
- end
117
-
118
- with_value(:big) do
119
- it_should_raise_an_exception
120
- end
44
+ it_should_assign_and_output_xml 1440
45
+ it_should_not_allow_negative_numbers
46
+ it_should_not_allow_floats
47
+ it_should_not_allow_invalid_value
121
48
  end
122
49
 
123
50
  for_attribute(:top) do
124
- with_value(1440) do
125
- it_should_assign_successfully
126
- it_should_output "<w:pgMar w:top=\"1440\"/>"
127
- end
128
-
129
- with_value(-1440) do
130
- it_should_assign_successfully
131
- it_should_output "<w:pgMar w:top=\"-1440\"/>"
132
- end
133
-
134
- with_value(9832.1) do
135
- it_should_raise_an_exception
136
- end
137
-
138
- with_value(:big) do
139
- it_should_raise_an_exception
140
- end
51
+ values = [1440, -1440]
52
+ it_should_assign_and_output_xml values
53
+ it_should_not_allow_floats
54
+ it_should_not_allow_invalid_value
141
55
  end
142
56
 
143
57
  with_no_attributes_set do
@@ -6,382 +6,41 @@ describe OpenXml::Docx::Properties::PageNumbering do
6
6
  it_should_use tag: :pgNumType, name: "page_numbering"
7
7
 
8
8
  for_attribute(:chapter_separator) do
9
- with_value(:colon) do
10
- it_should_assign_successfully
11
- it_should_output "<w:pgNumType w:chapSep=\"colon\"/>"
12
- end
13
-
14
- with_value(:emDash) do
15
- it_should_assign_successfully
16
- it_should_output "<w:pgNumType w:chapSep=\"emDash\"/>"
17
- end
18
-
19
- with_value(:enDash) do
20
- it_should_assign_successfully
21
- it_should_output "<w:pgNumType w:chapSep=\"enDash\"/>"
22
- end
23
-
24
- with_value(:hyphen) do
25
- it_should_assign_successfully
26
- it_should_output "<w:pgNumType w:chapSep=\"hyphen\"/>"
27
- end
28
-
29
- with_value(:period) do
30
- it_should_assign_successfully
31
- it_should_output "<w:pgNumType w:chapSep=\"period\"/>"
32
- end
9
+ values = %i(colon emDash enDash hyphen period)
10
+ it_should_assign_and_output_xml values
33
11
  end
34
12
 
35
13
  for_attribute(:chapter_style) do
36
- with_value(1) do
37
- it_should_assign_successfully
38
- it_should_output "<w:pgNumType w:chapStyle=\"1\"/>"
39
- end
40
-
41
- with_value(-10) do
42
- it_should_assign_successfully
43
- it_should_output "<w:pgNumType w:chapStyle=\"-10\"/>"
44
- end
45
-
46
- with_value(122.2) do
47
- it_should_raise_an_exception
48
- end
49
-
50
- with_value(:cool) do
51
- it_should_raise_an_exception
52
- end
14
+ values = [1, -10]
15
+ it_should_assign_and_output_xml values
16
+ it_should_not_allow_floats
17
+ it_should_not_allow_invalid_value
53
18
  end
54
19
 
55
20
  for_attribute(:format) do
56
- with_value(:aiueo) do
57
- it_should_assign_successfully
58
- it_should_output "<w:pgNumType w:fmt=\"aiueo\"/>"
59
- end
60
-
61
- with_value(:aiueoFullWidth) do
62
- it_should_assign_successfully
63
- it_should_output "<w:pgNumType w:fmt=\"aiueoFullWidth\"/>"
64
- end
65
-
66
- with_value(:arabicAbjad) do
67
- it_should_assign_successfully
68
- it_should_output "<w:pgNumType w:fmt=\"arabicAbjad\"/>"
69
- end
70
-
71
- with_value(:arabicAlpha) do
72
- it_should_assign_successfully
73
- it_should_output "<w:pgNumType w:fmt=\"arabicAlpha\"/>"
74
- end
75
-
76
- with_value(:bahtText) do
77
- it_should_assign_successfully
78
- it_should_output "<w:pgNumType w:fmt=\"bahtText\"/>"
79
- end
80
-
81
- with_value(:bullet) do
82
- it_should_assign_successfully
83
- it_should_output "<w:pgNumType w:fmt=\"bullet\"/>"
84
- end
85
-
86
- with_value(:cardinalText) do
87
- it_should_assign_successfully
88
- it_should_output "<w:pgNumType w:fmt=\"cardinalText\"/>"
89
- end
90
-
91
- with_value(:chicago) do
92
- it_should_assign_successfully
93
- it_should_output "<w:pgNumType w:fmt=\"chicago\"/>"
94
- end
95
-
96
- with_value(:chineseCounting) do
97
- it_should_assign_successfully
98
- it_should_output "<w:pgNumType w:fmt=\"chineseCounting\"/>"
99
- end
100
-
101
- with_value(:chineseCountingThousand) do
102
- it_should_assign_successfully
103
- it_should_output "<w:pgNumType w:fmt=\"chineseCountingThousand\"/>"
104
- end
105
-
106
- with_value(:chineseLegalSimplified) do
107
- it_should_assign_successfully
108
- it_should_output "<w:pgNumType w:fmt=\"chineseLegalSimplified\"/>"
109
- end
110
-
111
- with_value(:chosung) do
112
- it_should_assign_successfully
113
- it_should_output "<w:pgNumType w:fmt=\"chosung\"/>"
114
- end
115
-
116
- with_value(:custom) do
117
- it_should_assign_successfully
118
- it_should_output "<w:pgNumType w:fmt=\"custom\"/>"
119
- end
120
-
121
- with_value(:decimal) do
122
- it_should_assign_successfully
123
- it_should_output "<w:pgNumType w:fmt=\"decimal\"/>"
124
- end
125
-
126
- with_value(:decimalEnclosedCircle) do
127
- it_should_assign_successfully
128
- it_should_output "<w:pgNumType w:fmt=\"decimalEnclosedCircle\"/>"
129
- end
130
-
131
- with_value(:decimalEnclosedCircleChinese) do
132
- it_should_assign_successfully
133
- it_should_output "<w:pgNumType w:fmt=\"decimalEnclosedCircleChinese\"/>"
134
- end
135
-
136
- with_value(:decimalEnclosedFullstop) do
137
- it_should_assign_successfully
138
- it_should_output "<w:pgNumType w:fmt=\"decimalEnclosedFullstop\"/>"
139
- end
140
-
141
- with_value(:decimalEnclosedParen) do
142
- it_should_assign_successfully
143
- it_should_output "<w:pgNumType w:fmt=\"decimalEnclosedParen\"/>"
144
- end
145
-
146
- with_value(:decimalFullWidth) do
147
- it_should_assign_successfully
148
- it_should_output "<w:pgNumType w:fmt=\"decimalFullWidth\"/>"
149
- end
150
-
151
- with_value(:decimalHalfWidth) do
152
- it_should_assign_successfully
153
- it_should_output "<w:pgNumType w:fmt=\"decimalHalfWidth\"/>"
154
- end
155
-
156
- with_value(:decimalZero) do
157
- it_should_assign_successfully
158
- it_should_output "<w:pgNumType w:fmt=\"decimalZero\"/>"
159
- end
160
-
161
- with_value(:dollarText) do
162
- it_should_assign_successfully
163
- it_should_output "<w:pgNumType w:fmt=\"dollarText\"/>"
164
- end
165
-
166
- with_value(:ganada) do
167
- it_should_assign_successfully
168
- it_should_output "<w:pgNumType w:fmt=\"ganada\"/>"
169
- end
170
-
171
- with_value(:hebrew1) do
172
- it_should_assign_successfully
173
- it_should_output "<w:pgNumType w:fmt=\"hebrew1\"/>"
174
- end
175
-
176
- with_value(:hebrew2) do
177
- it_should_assign_successfully
178
- it_should_output "<w:pgNumType w:fmt=\"hebrew2\"/>"
179
- end
180
-
181
- with_value(:hex) do
182
- it_should_assign_successfully
183
- it_should_output "<w:pgNumType w:fmt=\"hex\"/>"
184
- end
185
-
186
- with_value(:hindiConsonants) do
187
- it_should_assign_successfully
188
- it_should_output "<w:pgNumType w:fmt=\"hindiConsonants\"/>"
189
- end
190
-
191
- with_value(:hindiCounting) do
192
- it_should_assign_successfully
193
- it_should_output "<w:pgNumType w:fmt=\"hindiCounting\"/>"
194
- end
195
-
196
- with_value(:hindiNumbers) do
197
- it_should_assign_successfully
198
- it_should_output "<w:pgNumType w:fmt=\"hindiNumbers\"/>"
199
- end
200
-
201
- with_value(:hindiVowels) do
202
- it_should_assign_successfully
203
- it_should_output "<w:pgNumType w:fmt=\"hindiVowels\"/>"
204
- end
205
-
206
- with_value(:ideographDigital) do
207
- it_should_assign_successfully
208
- it_should_output "<w:pgNumType w:fmt=\"ideographDigital\"/>"
209
- end
210
-
211
- with_value(:ideographEnclosedCircle) do
212
- it_should_assign_successfully
213
- it_should_output "<w:pgNumType w:fmt=\"ideographEnclosedCircle\"/>"
214
- end
215
-
216
- with_value(:ideographLegalTraditional) do
217
- it_should_assign_successfully
218
- it_should_output "<w:pgNumType w:fmt=\"ideographLegalTraditional\"/>"
219
- end
220
-
221
- with_value(:ideographTraditional) do
222
- it_should_assign_successfully
223
- it_should_output "<w:pgNumType w:fmt=\"ideographTraditional\"/>"
224
- end
225
-
226
- with_value(:ideographZodiac) do
227
- it_should_assign_successfully
228
- it_should_output "<w:pgNumType w:fmt=\"ideographZodiac\"/>"
229
- end
230
-
231
- with_value(:ideographZodiacTraditional) do
232
- it_should_assign_successfully
233
- it_should_output "<w:pgNumType w:fmt=\"ideographZodiacTraditional\"/>"
234
- end
235
-
236
- with_value(:iroha) do
237
- it_should_assign_successfully
238
- it_should_output "<w:pgNumType w:fmt=\"iroha\"/>"
239
- end
240
-
241
- with_value(:irohaFullWidth) do
242
- it_should_assign_successfully
243
- it_should_output "<w:pgNumType w:fmt=\"irohaFullWidth\"/>"
244
- end
245
-
246
- with_value(:japaneseCounting) do
247
- it_should_assign_successfully
248
- it_should_output "<w:pgNumType w:fmt=\"japaneseCounting\"/>"
249
- end
250
-
251
- with_value(:japaneseDigitalTenThousand) do
252
- it_should_assign_successfully
253
- it_should_output "<w:pgNumType w:fmt=\"japaneseDigitalTenThousand\"/>"
254
- end
255
-
256
- with_value(:japaneseLegal) do
257
- it_should_assign_successfully
258
- it_should_output "<w:pgNumType w:fmt=\"japaneseLegal\"/>"
259
- end
260
-
261
- with_value(:koreanCounting) do
262
- it_should_assign_successfully
263
- it_should_output "<w:pgNumType w:fmt=\"koreanCounting\"/>"
264
- end
265
-
266
- with_value(:koreanDigital) do
267
- it_should_assign_successfully
268
- it_should_output "<w:pgNumType w:fmt=\"koreanDigital\"/>"
269
- end
270
-
271
- with_value(:koreanDigital2) do
272
- it_should_assign_successfully
273
- it_should_output "<w:pgNumType w:fmt=\"koreanDigital2\"/>"
274
- end
275
-
276
- with_value(:koreanLegal) do
277
- it_should_assign_successfully
278
- it_should_output "<w:pgNumType w:fmt=\"koreanLegal\"/>"
279
- end
280
-
281
- with_value(:lowerLetter) do
282
- it_should_assign_successfully
283
- it_should_output "<w:pgNumType w:fmt=\"lowerLetter\"/>"
284
- end
285
-
286
- with_value(:lowerRoman) do
287
- it_should_assign_successfully
288
- it_should_output "<w:pgNumType w:fmt=\"lowerRoman\"/>"
289
- end
290
-
291
- with_value(:none) do
292
- it_should_assign_successfully
293
- it_should_output "<w:pgNumType w:fmt=\"none\"/>"
294
- end
295
-
296
- with_value(:numberInDash) do
297
- it_should_assign_successfully
298
- it_should_output "<w:pgNumType w:fmt=\"numberInDash\"/>"
299
- end
300
-
301
- with_value(:ordinal) do
302
- it_should_assign_successfully
303
- it_should_output "<w:pgNumType w:fmt=\"ordinal\"/>"
304
- end
305
-
306
- with_value(:ordinalText) do
307
- it_should_assign_successfully
308
- it_should_output "<w:pgNumType w:fmt=\"ordinalText\"/>"
309
- end
310
-
311
- with_value(:russianLower) do
312
- it_should_assign_successfully
313
- it_should_output "<w:pgNumType w:fmt=\"russianLower\"/>"
314
- end
315
-
316
- with_value(:russianUpper) do
317
- it_should_assign_successfully
318
- it_should_output "<w:pgNumType w:fmt=\"russianUpper\"/>"
319
- end
320
-
321
- with_value(:taiwaneseCounting) do
322
- it_should_assign_successfully
323
- it_should_output "<w:pgNumType w:fmt=\"taiwaneseCounting\"/>"
324
- end
325
-
326
- with_value(:taiwaneseCountingThousand) do
327
- it_should_assign_successfully
328
- it_should_output "<w:pgNumType w:fmt=\"taiwaneseCountingThousand\"/>"
329
- end
330
-
331
- with_value(:taiwaneseDigital) do
332
- it_should_assign_successfully
333
- it_should_output "<w:pgNumType w:fmt=\"taiwaneseDigital\"/>"
334
- end
335
-
336
- with_value(:thaiCounting) do
337
- it_should_assign_successfully
338
- it_should_output "<w:pgNumType w:fmt=\"thaiCounting\"/>"
339
- end
340
-
341
- with_value(:thaiLetters) do
342
- it_should_assign_successfully
343
- it_should_output "<w:pgNumType w:fmt=\"thaiLetters\"/>"
344
- end
345
-
346
- with_value(:thaiNumbers) do
347
- it_should_assign_successfully
348
- it_should_output "<w:pgNumType w:fmt=\"thaiNumbers\"/>"
349
- end
350
-
351
- with_value(:upperLetter) do
352
- it_should_assign_successfully
353
- it_should_output "<w:pgNumType w:fmt=\"upperLetter\"/>"
354
- end
355
-
356
- with_value(:upperRoman) do
357
- it_should_assign_successfully
358
- it_should_output "<w:pgNumType w:fmt=\"upperRoman\"/>"
359
- end
360
-
361
- with_value(:vietnameseCounting) do
362
- it_should_assign_successfully
363
- it_should_output "<w:pgNumType w:fmt=\"vietnameseCounting\"/>"
364
- end
21
+ values = %i(aiueo aiueoFullWidth arabicAbjad arabicAlpha bahtText
22
+ bullet cardinalText chicago chineseCounting chineseCountingThousand
23
+ chineseLegalSimplified chosung custom decimal decimalEnclosedCircle
24
+ decimalEnclosedCircleChinese decimalEnclosedFullstop decimalEnclosedParen
25
+ decimalFullWidth decimalHalfWidth decimalZero dollarText ganada
26
+ hebrew1 hebrew2 hex hindiConsonants hindiNumbers hindiVowels
27
+ ideographDigital ideographEnclosedCircle ideographLegalTraditional
28
+ ideographTraditional ideographZodiac ideographZodiacTraditional
29
+ iroha irohaFullWidth japaneseCounting japaneseDigitalTenThousand
30
+ japaneseLegal koreanCounting koreanDigital koreanDigital2
31
+ koreanLegal lowerLetter lowerRoman none numberInDash ordinal
32
+ ordinalText russianLower russianUpper taiwaneseCounting
33
+ taiwaneseCountingThousand taiwaneseDigital thaiCounting thaiLetters
34
+ thaiNumbers upperLetter upperRoman vietnameseCounting)
35
+ it_should_assign_and_output_xml values
36
+ it_should_not_allow_invalid_value
365
37
  end
366
38
 
367
39
  for_attribute(:start) do
368
- with_value(1) do
369
- it_should_assign_successfully
370
- it_should_output "<w:pgNumType w:start=\"1\"/>"
371
- end
372
-
373
- with_value(-10) do
374
- it_should_assign_successfully
375
- it_should_output "<w:pgNumType w:start=\"-10\"/>"
376
- end
377
-
378
- with_value(122.2) do
379
- it_should_raise_an_exception
380
- end
381
-
382
- with_value(:cool) do
383
- it_should_raise_an_exception
384
- end
40
+ values = [1, -10]
41
+ it_should_assign_and_output_xml values
42
+ it_should_not_allow_floats
43
+ it_should_not_allow_invalid_value
385
44
  end
386
45
 
387
46
  with_no_attributes_set do