rocx 0.6.0 → 0.7.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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rocx.rb +2 -0
- data/lib/rocx/elements/container.rb +2 -56
- data/lib/rocx/elements/paper_source.rb +11 -0
- data/lib/rocx/elements/paragraph.rb +16 -1
- data/lib/rocx/parts/document.rb +18 -4
- data/lib/rocx/properties.rb +1 -0
- data/lib/rocx/properties/column.rb +16 -0
- data/lib/rocx/properties/columns.rb +13 -0
- data/lib/rocx/properties/container_property.rb +63 -0
- data/lib/rocx/properties/document_grid.rb +20 -0
- data/lib/rocx/properties/form_protection.rb +7 -0
- data/lib/rocx/properties/line_numbering.rb +21 -0
- data/lib/rocx/properties/page_borders.rb +59 -0
- data/lib/rocx/properties/page_margins.rb +15 -0
- data/lib/rocx/properties/page_numbering.rb +87 -0
- data/lib/rocx/properties/page_size.rb +21 -0
- data/lib/rocx/properties/{borders.rb → paragraph_borders.rb} +3 -2
- data/lib/rocx/properties/rtl_gutter.rb +6 -0
- data/lib/rocx/properties/section_type.rb +13 -0
- data/lib/rocx/properties/tabs.rb +2 -41
- data/lib/rocx/properties/vertical_text_alignment.rb +12 -0
- data/lib/rocx/property_builder.rb +72 -0
- data/lib/rocx/section.rb +34 -0
- data/lib/rocx/version.rb +1 -1
- data/spec/elements/ruby_spec.rb +5 -5
- data/spec/parts/document_spec.rb +63 -0
- data/spec/properties/column_spec.rb +46 -0
- data/spec/properties/columns_spec.rb +174 -0
- data/spec/properties/document_grid_spec.rb +78 -0
- data/spec/properties/form_protection_spec.rb +23 -0
- data/spec/properties/line_numbering_spec.rb +96 -0
- data/spec/properties/page_borders_spec.rb +129 -0
- data/spec/properties/page_margins_spec.rb +150 -0
- data/spec/properties/page_numbering_spec.rb +395 -0
- data/spec/properties/page_size_spec.rb +90 -0
- data/spec/properties/paper_source_spec.rb +56 -0
- data/spec/properties/{borders_spec.rb → paragraph_borders_spec.rb} +1 -1
- data/spec/properties/rtl_gutter_spec.rb +23 -0
- data/spec/properties/section_type_spec.rb +33 -0
- data/spec/properties/vertical_text_alignment_spec.rb +28 -0
- data/spec/section_spec.rb +44 -0
- data/spec/support/data/parts/document_with_multiple_sections_part.xml +24 -0
- data/spec/support/data/parts/document_with_one_section_part.xml +16 -0
- data/spec/support/element_test_macros.rb +28 -8
- data/spec/support/part_test_macros.rb +1 -1
- data/spec/support/property_test_macros.rb +4 -4
- metadata +36 -4
@@ -0,0 +1,395 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Rocx::Properties::PageNumbering do
|
4
|
+
include PropertyTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :pgNumType, name: "page_numbering"
|
7
|
+
|
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
|
33
|
+
end
|
34
|
+
|
35
|
+
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
|
53
|
+
end
|
54
|
+
|
55
|
+
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
|
365
|
+
end
|
366
|
+
|
367
|
+
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
|
385
|
+
end
|
386
|
+
|
387
|
+
with_no_attributes_set do
|
388
|
+
it_should_output "", assign: false
|
389
|
+
end
|
390
|
+
|
391
|
+
with_these_attributes_set(chapter_separator: :colon, chapter_style: 1, format: :taiwaneseCountingThousand, start: 2) do
|
392
|
+
it_should_output "<w:pgNumType w:chapSep=\"colon\" w:chapStyle=\"1\" w:fmt=\"taiwaneseCountingThousand\" w:start=\"2\"/>", assign: false
|
393
|
+
end
|
394
|
+
|
395
|
+
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Rocx::Properties::PageSize do
|
4
|
+
include PropertyTestMacros
|
5
|
+
|
6
|
+
it_should_use tag: :pgSz, name: "page_size"
|
7
|
+
|
8
|
+
for_attribute(:code) do
|
9
|
+
with_value(1) do
|
10
|
+
it_should_assign_successfully
|
11
|
+
it_should_output "<w:pgSz w:code=\"1\"/>"
|
12
|
+
end
|
13
|
+
|
14
|
+
with_value(-10) do
|
15
|
+
it_should_assign_successfully
|
16
|
+
it_should_output "<w:pgSz w:code=\"-10\"/>"
|
17
|
+
end
|
18
|
+
|
19
|
+
with_value(122.2) do
|
20
|
+
it_should_raise_an_exception
|
21
|
+
end
|
22
|
+
|
23
|
+
with_value(:cool) do
|
24
|
+
it_should_raise_an_exception
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
for_attribute(:height) do
|
29
|
+
with_value(1) do
|
30
|
+
it_should_assign_successfully
|
31
|
+
it_should_output "<w:pgSz w:h=\"1\"/>"
|
32
|
+
end
|
33
|
+
|
34
|
+
with_value(-10) do
|
35
|
+
it_should_raise_an_exception
|
36
|
+
end
|
37
|
+
|
38
|
+
with_value(122.2) do
|
39
|
+
it_should_raise_an_exception
|
40
|
+
end
|
41
|
+
|
42
|
+
with_value(:cool) do
|
43
|
+
it_should_raise_an_exception
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
for_attribute(:orientation) do
|
48
|
+
with_value(:portrait) do
|
49
|
+
it_should_assign_successfully
|
50
|
+
it_should_output "<w:pgSz w:orient=\"portrait\"/>"
|
51
|
+
end
|
52
|
+
|
53
|
+
with_value(:landscape) do
|
54
|
+
it_should_assign_successfully
|
55
|
+
it_should_output "<w:pgSz w:orient=\"landscape\"/>"
|
56
|
+
end
|
57
|
+
|
58
|
+
with_value(:somethingWeird) do
|
59
|
+
it_should_raise_an_exception
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
for_attribute(:width) do
|
64
|
+
with_value(1) do
|
65
|
+
it_should_assign_successfully
|
66
|
+
it_should_output "<w:pgSz w:w=\"1\"/>"
|
67
|
+
end
|
68
|
+
|
69
|
+
with_value(-10) do
|
70
|
+
it_should_raise_an_exception
|
71
|
+
end
|
72
|
+
|
73
|
+
with_value(122.2) do
|
74
|
+
it_should_raise_an_exception
|
75
|
+
end
|
76
|
+
|
77
|
+
with_value(:cool) do
|
78
|
+
it_should_raise_an_exception
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
with_no_attributes_set do
|
83
|
+
it_should_output "", assign: false
|
84
|
+
end
|
85
|
+
|
86
|
+
with_these_attributes_set(width: 12240, height: 5000, orientation: :landscape) do
|
87
|
+
it_should_output "<w:pgSz w:h=\"5000\" w:orient=\"landscape\" w:w=\"12240\"/>", assign: false
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|