metanorma-iso 1.5.14 → 1.7.2

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +17 -0
  3. data/.rubocop.yml +0 -4
  4. data/lib/asciidoctor/iso/base.rb +13 -13
  5. data/lib/asciidoctor/iso/basicdoc.rng +20 -3
  6. data/lib/asciidoctor/iso/cleanup.rb +1 -1
  7. data/lib/asciidoctor/iso/front.rb +5 -5
  8. data/lib/asciidoctor/iso/isodoc.rng +118 -4
  9. data/lib/asciidoctor/iso/isostandard-amd.rng +11 -4
  10. data/lib/asciidoctor/iso/isostandard.rng +22 -10
  11. data/lib/asciidoctor/iso/validate.rb +78 -0
  12. data/lib/asciidoctor/iso/validate_section.rb +12 -9
  13. data/lib/isodoc/iso/html/header.html +12 -12
  14. data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
  15. data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
  16. data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
  17. data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
  18. data/lib/isodoc/iso/html_convert.rb +2 -2
  19. data/lib/isodoc/iso/i18n-en.yaml +2 -0
  20. data/lib/isodoc/iso/i18n-fr.yaml +1 -1
  21. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -1
  22. data/lib/isodoc/iso/iso.amendment.xsl +451 -208
  23. data/lib/isodoc/iso/iso.international-standard.xsl +451 -208
  24. data/lib/isodoc/iso/sections.rb +1 -1
  25. data/lib/isodoc/iso/word_convert.rb +2 -2
  26. data/lib/isodoc/iso/xref.rb +28 -12
  27. data/lib/metanorma/iso/processor.rb +11 -0
  28. data/lib/metanorma/iso/version.rb +1 -1
  29. data/metanorma-iso.gemspec +2 -2
  30. data/spec/asciidoctor-iso/amd_spec.rb +575 -573
  31. data/spec/asciidoctor-iso/base_spec.rb +449 -458
  32. data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
  33. data/spec/asciidoctor-iso/cleanup_spec.rb +814 -699
  34. data/spec/asciidoctor-iso/inline_spec.rb +116 -91
  35. data/spec/asciidoctor-iso/lists_spec.rb +128 -121
  36. data/spec/asciidoctor-iso/refs_spec.rb +308 -250
  37. data/spec/asciidoctor-iso/section_spec.rb +273 -242
  38. data/spec/asciidoctor-iso/table_spec.rb +258 -242
  39. data/spec/asciidoctor-iso/validate_spec.rb +1223 -919
  40. data/spec/isodoc/amd_spec.rb +967 -946
  41. data/spec/isodoc/blocks_spec.rb +530 -507
  42. data/spec/isodoc/i18n_spec.rb +953 -911
  43. data/spec/isodoc/inline_spec.rb +355 -293
  44. data/spec/isodoc/iso_spec.rb +340 -316
  45. data/spec/isodoc/metadata_spec.rb +392 -382
  46. data/spec/isodoc/postproc_spec.rb +834 -656
  47. data/spec/isodoc/ref_spec.rb +374 -331
  48. data/spec/isodoc/section_spec.rb +608 -525
  49. data/spec/isodoc/table_spec.rb +472 -411
  50. data/spec/isodoc/terms_spec.rb +209 -185
  51. data/spec/isodoc/xref_spec.rb +1370 -1236
  52. data/spec/metanorma/processor_spec.rb +28 -26
  53. data/spec/spec_helper.rb +184 -189
  54. metadata +7 -10
  55. data/.rubocop.ribose.yml +0 -66
  56. data/lib/metanorma/iso/fonts_manifest.yaml +0 -6
  57. data/spec/assets/xref_error.adoc +0 -7
@@ -3,343 +3,464 @@ require "fileutils"
3
3
 
4
4
  RSpec.describe Asciidoctor::ISO do
5
5
  context "when xref_error.adoc compilation" do
6
- around do |example|
7
- FileUtils.rm_f "spec/assets/xref_error.err"
8
- example.run
9
- Dir["spec/assets/xref_error*"].each do |file|
10
- next if file.match?(/adoc$/)
6
+ it "generates error file" do
7
+ File.write("xref_error.adoc", <<~"CONTENT")
8
+ = X
9
+ A
11
10
 
12
- FileUtils.rm_f(file)
13
- end
14
- end
11
+ == Clause
12
+
13
+ <<a,b>>
14
+ CONTENT
15
15
 
16
- it "generates error file" do
17
16
  expect do
17
+ mock_pdf
18
18
  Metanorma::Compile
19
19
  .new
20
- .compile("spec/assets/xref_error.adoc", type: "iso")
21
- end.to(change { File.exist?("spec/assets/xref_error.err") }
20
+ .compile("xref_error.adoc", type: "iso", no_install_fonts: true)
21
+ end.to(change { File.exist?("xref_error.err") }
22
22
  .from(false).to(true))
23
23
  end
24
24
  end
25
25
 
26
- it "Warns of missing scope" do
27
- FileUtils.rm_f "test.err"
28
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
29
- = Document title
30
- Author
31
- :docfile: test.adoc
32
- :nodoc:
33
- :no-isobib:
34
- :doctype: pizza
35
-
36
- text
37
- INPUT
38
- expect(File.read("test.err")).to include "Scope clause missing"
39
- FileUtils.rm_f "test.err"
40
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
41
- = Document title
42
- Author
43
- :docfile: test.adoc
44
- :nodoc:
45
- :no-isobib:
46
- :doctype: pizza
47
-
48
- == Scope
49
- INPUT
50
- expect(File.read("test.err")).not_to include "Scope clause missing"
26
+ it "Warns of image names not compliant with DRG" do
27
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
28
+ = Document title
29
+ Author
30
+ :docfile: test.adoc
31
+ :nodoc:
32
+ :no-isobib:
33
+ :docnumber: 1000
34
+ :partnumber: 1
35
+ :edition: 2
36
+ :amendment-number: 3
37
+
38
+ .Split-it-right sample divider
39
+ image::spec/examples/rice_images/rice_image1.png[]
40
+ image::spec/examples/rice_images/SL1000-1_ed2amd3fig1.png[]
41
+ image::spec/examples/rice_images/1001_ed2amd3fig1.png[]
42
+ image::spec/examples/rice_images/ISO_1213_1.png[]
43
+ image::spec/examples/rice_images/1000-1_ed2amd3figA.png[]
44
+
45
+ |===
46
+ |a |b
47
+
48
+ a|image::spec/examples/rice_images/1000-1_ed2amd3figTab1.png[]#{' '}
49
+ a|image::spec/examples/rice_images/1000-1_ed2amd3fig2.png[]
50
+ |===
51
+
52
+ image::spec/examples/rice_images/1000-1_ed2amd3figTab2.png[]
53
+
54
+ image::spec/examples/rice_images/1000-1_ed2amd3figA1.png[]
55
+ image::spec/examples/rice_images/1000-1_ed2amd3fig1a.png[]
56
+
57
+ .Stages of gelatinization
58
+ ====
59
+ image::spec/examples/rice_images/1000-1_ed2amd3fig1b.png[]
60
+
61
+ image::spec/examples/rice_images/1000-1_ed2amd3fig4.png[]
62
+ ====
63
+
64
+ image::spec/examples/rice_images/1000-1_ed2amd3fig5_f.png[]
65
+
66
+ [appendix]
67
+ == Annex
68
+ image::spec/examples/rice_images/1000-1_ed2amd3figA2.png[]
69
+ image::spec/examples/rice_images/1000-1_ed2amd3fig3.png[]
70
+
71
+ INPUT
72
+ expect(File.read("test.err")).to include \
73
+ "image name spec/examples/rice_images/rice_image1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
74
+ expect(File.read("test.err")).to include \
75
+ "image name spec/examples/rice_images/1001_ed2amd3fig1.png does not match DRG requirements: " \
76
+ "expect 1000-1_ed2amd3fig"
77
+ expect(File.read("test.err")).not_to include \
78
+ "image name spec/examples/rice_images/SL1000-1_ed2amd3fig1.png does not match DRG requirements: " \
79
+ "expect 1000-1_ed2amd3fig"
80
+ expect(File.read("test.err")).not_to include \
81
+ "image name spec/examples/rice_images/ISO_1213_1.png does not match DRG requirements: expect 1000-1_ed2amd3fig"
82
+ expect(File.read("test.err")).to include \
83
+ "image name spec/examples/rice_images/1000-1_ed2amd3figA.png does not match DRG requirements"
84
+ expect(File.read("test.err")).not_to include \
85
+ "image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png does not match DRG requirements"
86
+ expect(File.read("test.err")).not_to include \
87
+ "image name spec/examples/rice_images/1000-1_ed2amd3figTab1.png is under a table but is not so labelled"
88
+ expect(File.read("test.err")).to include \
89
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig2.png is under a table but is not so labelled"
90
+ expect(File.read("test.err")).to include \
91
+ "image name spec/examples/rice_images/1000-1_ed2amd3figTab2.png is labelled as under a table but is not"
92
+ expect(File.read("test.err")).not_to include \
93
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is labelled as under a table but is not"
94
+ expect(File.read("test.err")).not_to include \
95
+ "image name spec/examples/rice_images/1000-1_ed2amd3figA2.png is under an annex but is not so labelled"
96
+ expect(File.read("test.err")).to include \
97
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig3.png is under an annex but is not so labelled"
98
+ expect(File.read("test.err")).to include \
99
+ "image name spec/examples/rice_images/1000-1_ed2amd3figA1.png is labelled as under an annex but is not"
100
+ expect(File.read("test.err")).not_to include \
101
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png is labelled as under an annex but is not"
102
+ expect(File.read("test.err")).not_to include \
103
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig1b.png has a subfigure letter but is not a subfigure"
104
+ expect(File.read("test.err")).to include \
105
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig4.png does not have a subfigure letter but is a subfigure"
106
+ expect(File.read("test.err")).to include \
107
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig1a.png has a subfigure letter but is not a subfigure"
108
+ expect(File.read("test.err")).not_to include \
109
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png has a subfigure letter but is not a subfigure"
110
+ expect(File.read("test.err")).to include \
111
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig5_f.png expected to have suffix _e"
112
+ expect(File.read("test.err")).not_to include \
113
+ "image name spec/examples/rice_images/1000-1_ed2amd3fig1.png expected to have suffix _e"
114
+ end
51
115
 
52
- end
116
+ context "Warns of missing scope" do
117
+ it "Scope clause missing" do
118
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
119
+ = Document title
120
+ Author
121
+ :docfile: test.adoc
122
+ :nodoc:
123
+ :no-isobib:
124
+ :doctype: pizza
125
+
126
+ text
127
+ INPUT
53
128
 
54
- it "Warns of missing normative references" do
55
- FileUtils.rm_f "test.err"
56
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
57
- = Document title
58
- Author
59
- :docfile: test.adoc
60
- :nodoc:
61
- :no-isobib:
62
- :doctype: pizza
63
-
64
- text
65
- INPUT
66
- expect(File.read("test.err")).to include "Normative references missing"
67
- FileUtils.rm_f "test.err"
68
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
69
- = Document title
70
- Author
71
- :docfile: test.adoc
72
- :nodoc:
73
- :no-isobib:
74
- :doctype: pizza
75
-
76
- [bibliography]
77
- == Normative references
78
- INPUT
79
- expect(File.read("test.err")).not_to include "Normative references missing"
129
+ expect(File.read("test.err")).to include "Scope clause missing"
130
+ end
80
131
 
81
- end
132
+ it "Scope clause not missing 1" do
133
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
134
+ = Document title
135
+ Author
136
+ :docfile: test.adoc
137
+ :nodoc:
138
+ :no-isobib:
139
+ :doctype: pizza
82
140
 
83
- it "Warns of missing terms & definitions" do
84
- FileUtils.rm_f "test.err"
85
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
86
- = Document title
87
- Author
88
- :docfile: test.adoc
89
- :nodoc:
90
- :no-isobib:
91
- :doctype: pizza
92
-
93
- text
94
- INPUT
95
- expect(File.read("test.err")).to include "Terms & definitions missing"
96
- FileUtils.rm_f "test.err"
97
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
98
- = Document title
99
- Author
100
- :docfile: test.adoc
101
- :nodoc:
102
- :no-isobib:
103
- :doctype: pizza
104
-
105
- == Terms and definitions
106
- === Term 1
107
- INPUT
108
- expect(File.read("test.err")).not_to include "Terms & definitions missing"
141
+ == Scope
142
+ INPUT
143
+ expect(File.read("test.err")).not_to include "Scope clause missing"
144
+ end
109
145
 
110
- end
146
+ it "Scope clause not missing 2" do
147
+ FileUtils.rm_f "test.err"
148
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
149
+ = Document title
150
+ Author
151
+ :docfile: test.adoc
152
+ :nodoc:
153
+ :no-isobib:
154
+ :doctype: amendment
155
+
156
+ text
157
+ INPUT
158
+ expect(File.read("test.err")).not_to include "Scope clause missing"
159
+ end
160
+ end
161
+
162
+ context "Warns of missing normative references" do
163
+ it "Normative references missing" do
164
+ FileUtils.rm_f "test.err"
165
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
166
+ = Document title
167
+ Author
168
+ :docfile: test.adoc
169
+ :nodoc:
170
+ :no-isobib:
171
+ :doctype: pizza
172
+
173
+ text
174
+ INPUT
175
+ expect(File.read("test.err")).to include "Normative references missing"
176
+ end
177
+
178
+ it "Normative references not missing 1" do
179
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
180
+ = Document title
181
+ Author
182
+ :docfile: test.adoc
183
+ :nodoc:
184
+ :no-isobib:
185
+ :doctype: pizza
186
+
187
+ [bibliography]
188
+ == Normative references
189
+ INPUT
190
+ expect(File.read("test.err")).not_to include "Normative references missing"
191
+ end
192
+
193
+ it "Normative references not missing 2" do
194
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
195
+ = Document title
196
+ Author
197
+ :docfile: test.adoc
198
+ :nodoc:
199
+ :no-isobib:
200
+ :doctype: amendment
201
+
202
+ text
203
+ INPUT
204
+ expect(File.read("test.err")).not_to include "Normative references missing"
205
+ end
206
+ end
111
207
 
208
+ context "Warns of missing terms & definitions" do
209
+ it "Terms & definitions missing" do
210
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
211
+ = Document title
212
+ Author
213
+ :docfile: test.adoc
214
+ :nodoc:
215
+ :no-isobib:
216
+ :doctype: pizza
217
+
218
+ text
219
+ INPUT
220
+ expect(File.read("test.err")).to include "Terms & definitions missing"
221
+ end
222
+
223
+ it "Terms & definitions not missing 1" do
224
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
225
+ = Document title
226
+ Author
227
+ :docfile: test.adoc
228
+ :nodoc:
229
+ :no-isobib:
230
+ :doctype: pizza
231
+
232
+ == Terms and definitions
233
+ === Term 1
234
+ INPUT
235
+ expect(File.read("test.err")).not_to include "Terms & definitions missing"
236
+ end
112
237
 
113
- it "Warns of illegal doctype" do
114
- FileUtils.rm_f "test.err"
115
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
116
- = Document title
117
- Author
118
- :docfile: test.adoc
119
- :nodoc:
120
- :no-isobib:
121
- :doctype: pizza
238
+ it "Terms & definitions not missing 2" do
239
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
240
+ = Document title
241
+ Author
242
+ :docfile: test.adoc
243
+ :nodoc:
244
+ :no-isobib:
245
+ :doctype: amendment
122
246
 
123
- text
124
- INPUT
247
+ text
248
+ INPUT
249
+ expect(File.read("test.err")).not_to include "Terms & definitions missing"
250
+ end
251
+ end
252
+
253
+ it "Warns of illegal doctype" do
254
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
255
+ = Document title
256
+ Author
257
+ :docfile: test.adoc
258
+ :nodoc:
259
+ :no-isobib:
260
+ :doctype: pizza
261
+
262
+ text
263
+ INPUT
125
264
  expect(File.read("test.err")).to include "pizza is not a recognised document type"
126
- end
265
+ end
127
266
 
128
- it "Warns of illegal script" do
129
- FileUtils.rm_f "test.err"
130
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
131
- = Document title
132
- Author
133
- :docfile: test.adoc
134
- :nodoc:
135
- :no-isobib:
136
- :script: pizza
137
-
138
- text
139
- INPUT
267
+ it "Warns of illegal script" do
268
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
269
+ = Document title
270
+ Author
271
+ :docfile: test.adoc
272
+ :nodoc:
273
+ :no-isobib:
274
+ :script: pizza
275
+
276
+ text
277
+ INPUT
140
278
  expect(File.read("test.err")).to include "pizza is not a recognised script"
141
- end
279
+ end
142
280
 
143
- it "Warns of illegal stage" do
144
- FileUtils.rm_f "test.err"
145
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
146
- = Document title
147
- Author
148
- :docfile: test.adoc
149
- :nodoc:
150
- :no-isobib:
151
- :status: pizza
152
-
153
- text
154
- INPUT
281
+ it "Warns of illegal stage" do
282
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
283
+ = Document title
284
+ Author
285
+ :docfile: test.adoc
286
+ :nodoc:
287
+ :no-isobib:
288
+ :status: pizza
289
+
290
+ text
291
+ INPUT
155
292
  expect(File.read("test.err")).to include "pizza is not a recognised stage"
156
- end
293
+ end
157
294
 
158
- it "Warns of illegal substage" do
159
- FileUtils.rm_f "test.err"
160
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
161
- = Document title
162
- Author
163
- :docfile: test.adoc
164
- :nodoc:
165
- :no-isobib:
166
- :status: 60
167
- :docsubstage: pizza
168
-
169
- text
170
- INPUT
295
+ it "Warns of illegal substage" do
296
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
297
+ = Document title
298
+ Author
299
+ :docfile: test.adoc
300
+ :nodoc:
301
+ :no-isobib:
302
+ :status: 60
303
+ :docsubstage: pizza
304
+
305
+ text
306
+ INPUT
171
307
  expect(File.read("test.err")).to include "pizza is not a recognised substage"
172
- end
308
+ end
173
309
 
174
- it "Warns of illegal iteration" do
175
- FileUtils.rm_f "test.err"
176
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
177
- = Document title
178
- Author
179
- :docfile: test.adoc
180
- :nodoc:
181
- :no-isobib:
182
- :status: 60
183
- :iteration: pizza
184
-
185
- text
186
- INPUT
310
+ it "Warns of illegal iteration" do
311
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
312
+ = Document title
313
+ Author
314
+ :docfile: test.adoc
315
+ :nodoc:
316
+ :no-isobib:
317
+ :status: 60
318
+ :iteration: pizza
319
+
320
+ text
321
+ INPUT
187
322
  expect(File.read("test.err")).to include "pizza is not a recognised iteration"
188
- end
323
+ end
189
324
 
190
- it "Warns of illegal script" do
191
- FileUtils.rm_f "test.err"
192
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
193
- = Document title
194
- Author
195
- :docfile: test.adoc
196
- :nodoc:
197
- :no-isobib:
198
- :script: pizza
199
-
200
- text
201
- INPUT
325
+ it "Warns of illegal script" do
326
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
327
+ = Document title
328
+ Author
329
+ :docfile: test.adoc
330
+ :nodoc:
331
+ :no-isobib:
332
+ :script: pizza
333
+
334
+ text
335
+ INPUT
202
336
  expect(File.read("test.err")).to include "pizza is not a recognised script"
203
- end
337
+ end
204
338
 
205
- it "warns that technical report may contain requirement" do
206
- FileUtils.rm_f "test.err"
207
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
208
- = Document title
209
- Author
210
- :docfile: test.adoc
211
- :nodoc:
212
- :no-isobib:
213
- :doctype: technical-report
339
+ it "warns that technical report may contain requirement" do
340
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
341
+ = Document title
342
+ Author
343
+ :docfile: test.adoc
344
+ :nodoc:
345
+ :no-isobib:
346
+ :doctype: technical-report
214
347
 
215
- == Random clause
348
+ == Random clause
216
349
 
217
- The widget is required not to be larger than 15 cm.
218
- INPUT
350
+ The widget is required not to be larger than 15 cm.
351
+ INPUT
219
352
  expect(File.read("test.err")).to include "Technical Report clause may contain requirement"
220
- end
221
-
353
+ end
222
354
 
223
- it "warns that introduction may contain requirement" do
224
- FileUtils.rm_f "test.err"
225
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
226
- #{VALIDATING_BLANK_HDR}
227
- == Introduction
355
+ it "warns that introduction may contain requirement" do
356
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
357
+ #{VALIDATING_BLANK_HDR}
358
+ == Introduction
228
359
 
229
- The widget is required not to be larger than 15 cm.
230
- INPUT
360
+ The widget is required not to be larger than 15 cm.
361
+ INPUT
231
362
  expect(File.read("test.err")).to include "Introduction may contain requirement"
232
- end
363
+ end
233
364
 
234
- it "warns that foreword may contain recommendation" do
235
- FileUtils.rm_f "test.err"
236
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
237
- #{VALIDATING_BLANK_HDR}
365
+ it "warns that foreword may contain recommendation" do
366
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
367
+ #{VALIDATING_BLANK_HDR}
238
368
 
239
- It is not recommended that widgets should be larger than 15 cm.
369
+ It is not recommended that widgets should be larger than 15 cm.
240
370
 
241
- == Clause
242
- INPUT
371
+ == Clause
372
+ INPUT
243
373
  expect(File.read("test.err")).to include "Foreword may contain recommendation"
244
- end
374
+ end
245
375
 
246
- it "warns that foreword may contain permission" do
247
- FileUtils.rm_f "test.err"
248
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
249
- #{VALIDATING_BLANK_HDR}
376
+ it "warns that foreword may contain permission" do
377
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
378
+ #{VALIDATING_BLANK_HDR}
250
379
 
251
- No widget is required to be larger than 15 cm.
380
+ No widget is required to be larger than 15 cm.
252
381
 
253
- == Clause
254
- INPUT
382
+ == Clause
383
+ INPUT
255
384
  expect(File.read("test.err")).to include "Foreword may contain permission"
256
- end
385
+ end
257
386
 
258
- it "warns that scope may contain recommendation" do
259
- FileUtils.rm_f "test.err"
260
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
261
- #{VALIDATING_BLANK_HDR}
387
+ it "warns that scope may contain recommendation" do
388
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
389
+ #{VALIDATING_BLANK_HDR}
262
390
 
263
- == Scope
264
- It is not recommended that widgets should be larger than 15 cm.
265
- INPUT
391
+ == Scope
392
+ It is not recommended that widgets should be larger than 15 cm.
393
+ INPUT
266
394
  expect(File.read("test.err")).to include "Scope may contain recommendation"
267
- end
395
+ end
268
396
 
269
- it "warns that definition may contain requirement" do
270
- FileUtils.rm_f "test.err"
271
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
272
- #{VALIDATING_BLANK_HDR}
397
+ it "warns that definition may contain requirement" do
398
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
399
+ #{VALIDATING_BLANK_HDR}
273
400
 
274
- == Terms and Definitions
401
+ == Terms and Definitions
275
402
 
276
- === Term1
403
+ === Term1
277
404
 
278
- It is required that there is a definition.
405
+ It is required that there is a definition.
279
406
 
280
- INPUT
407
+ INPUT
281
408
  expect(File.read("test.err")).to include "Definition may contain requirement"
282
- end
409
+ end
283
410
 
284
- it "warns that term example may contain recommendation" do
285
- FileUtils.rm_f "test.err"
286
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
287
- #{VALIDATING_BLANK_HDR}
411
+ it "warns that term example may contain recommendation" do
412
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
413
+ #{VALIDATING_BLANK_HDR}
288
414
 
289
- == Terms and Definitions
415
+ == Terms and Definitions
290
416
 
291
- === Term
417
+ === Term
292
418
 
293
- [example]
294
- It is not recommended that widgets should be larger than 15 cm.
295
- INPUT
419
+ [example]
420
+ It is not recommended that widgets should be larger than 15 cm.
421
+ INPUT
296
422
  expect(File.read("test.err")).to include "Example may contain recommendation"
297
- end
423
+ end
298
424
 
299
- it "warns that note may contain recommendation" do
300
- FileUtils.rm_f "test.err"
301
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
302
- #{VALIDATING_BLANK_HDR}
425
+ it "warns that note may contain recommendation" do
426
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
427
+ #{VALIDATING_BLANK_HDR}
303
428
 
304
- NOTE: It is not recommended that widgets should be larger than 15 cm.
305
- INPUT
429
+ NOTE: It is not recommended that widgets should be larger than 15 cm.
430
+ INPUT
306
431
  expect(File.read("test.err")).to include "Note may contain recommendation"
307
- end
432
+ end
308
433
 
309
- it "warns that footnote may contain recommendation" do
310
- FileUtils.rm_f "test.err"
311
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
312
- #{VALIDATING_BLANK_HDR}
434
+ it "warns that footnote may contain recommendation" do
435
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
436
+ #{VALIDATING_BLANK_HDR}
313
437
 
314
- footnote:[It is not recommended that widgets should be larger than 15 cm.]
315
- INPUT
438
+ footnote:[It is not recommended that widgets should be larger than 15 cm.]
439
+ INPUT
316
440
  expect(File.read("test.err")).to include "Footnote may contain recommendation"
317
- end
441
+ end
318
442
 
319
- it "warns that term source is not in expected format" do
320
- FileUtils.rm_f "test.err"
321
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
322
- #{VALIDATING_BLANK_HDR}
443
+ it "warns that term source is not in expected format" do
444
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
445
+ #{VALIDATING_BLANK_HDR}
323
446
 
324
- [.source]
325
- I am a generic paragraph
326
- INPUT
447
+ [.source]
448
+ I am a generic paragraph
449
+ INPUT
327
450
  expect(File.read("test.err")).to include "term reference not in expected format"
328
- end
451
+ end
329
452
 
330
- it "warns that figure does not have title" do
331
- FileUtils.rm_f "test.err"
332
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
333
- #{VALIDATING_BLANK_HDR}
453
+ it "warns that figure does not have title" do
454
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
455
+ #{VALIDATING_BLANK_HDR}
334
456
 
335
- image::spec/examples/rice_images/rice_image1.png[]
336
- INPUT
457
+ image::spec/examples/rice_images/rice_image1.png[]
458
+ INPUT
337
459
  expect(File.read("test.err")).to include "Figure should have title"
338
- end
460
+ end
339
461
 
340
- it "warns that callouts do not match annotations" do
341
- FileUtils.rm_f "test.err"
342
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
462
+ it "warns that callouts do not match annotations" do
463
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
343
464
  #{VALIDATING_BLANK_HDR}
344
465
  [source,ruby]
345
466
  --
@@ -350,902 +471,1085 @@ it "warns that callouts do not match annotations" do
350
471
  --
351
472
  <1> This is one callout
352
473
  <2> This is another callout
353
- INPUT
474
+ INPUT
354
475
  expect(File.read("test.err")).to include "mismatch of callouts and annotations"
355
- end
476
+ end
356
477
 
357
- it "warns that term source is not a real reference" do
358
- FileUtils.rm_f "test.err"
359
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
360
- #{VALIDATING_BLANK_HDR}
478
+ it "warns that term source is not a real reference" do
479
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
480
+ #{VALIDATING_BLANK_HDR}
361
481
 
362
- [.source]
363
- <<iso123>>
364
- INPUT
482
+ [.source]
483
+ <<iso123>>
484
+ INPUT
365
485
  expect(File.read("test.err")).to include "iso123 does not have a corresponding anchor ID in the bibliography"
366
- end
486
+ end
367
487
 
368
- it "warns that undated reference has locality" do
369
- FileUtils.rm_f "test.err"
370
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
371
- #{VALIDATING_BLANK_HDR}
488
+ it "warns that undated reference has locality" do
489
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
490
+ #{VALIDATING_BLANK_HDR}
372
491
 
373
- == Scope
374
- <<iso123,clause=1>>
492
+ == Scope
493
+ <<iso123,clause=1>>
375
494
 
376
- [bibliography]
377
- == Normative References
378
- * [[[iso123,ISO 123]]] _Standard_
379
- INPUT
495
+ [bibliography]
496
+ == Normative References
497
+ * [[[iso123,ISO 123]]] _Standard_
498
+ INPUT
380
499
  expect(File.read("test.err")).to include "undated reference ISO 123 should not contain specific elements"
381
- end
500
+ end
382
501
 
383
- it "do not warn that undated reference which is a bibliographic reference has locality" do
384
- FileUtils.rm_f "test.err"
385
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
386
- #{VALIDATING_BLANK_HDR}
502
+ it "do not warn that undated reference which is a bibliographic reference has locality" do
503
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
504
+ #{VALIDATING_BLANK_HDR}
387
505
 
388
- == Scope
389
- <<iso123,clause=1>>
506
+ == Scope
507
+ <<iso123,clause=1>>
390
508
 
391
- [bibliography]
392
- == Bibliography
393
- * [[[iso123,1]]] _Standard_
394
- INPUT
509
+ [bibliography]
510
+ == Bibliography
511
+ * [[[iso123,1]]] _Standard_
512
+ INPUT
395
513
  expect(File.read("test.err")).not_to include "undated reference [1] should not contain specific elements"
396
- end
514
+ end
397
515
 
398
- it "do not warn that undated IEV reference has locality" do
399
- FileUtils.rm_f "test.err"
400
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
401
- #{VALIDATING_BLANK_HDR}
516
+ it "do not warn that undated IEV reference has locality" do
517
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
518
+ #{VALIDATING_BLANK_HDR}
402
519
 
403
- == Scope
404
- <<iev,clause=1>>
520
+ == Scope
521
+ <<iev,clause=1>>
405
522
 
406
- [bibliography]
407
- == Normative References
408
- * [[[iev,IEV]]] _Standard_
409
- INPUT
523
+ [bibliography]
524
+ == Normative References
525
+ * [[[iev,IEV]]] _Standard_
526
+ INPUT
410
527
  expect(File.read("test.err")).not_to include "undated reference IEV should not contain specific elements"
411
- end
528
+ end
412
529
 
413
- it "do not warn that in print has locality" do
414
- FileUtils.rm_f "test.err"
415
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
416
- #{VALIDATING_BLANK_HDR}
530
+ it "do not warn that in print has locality" do
531
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
532
+ #{VALIDATING_BLANK_HDR}
417
533
 
418
- == Scope
419
- <<iev,clause=1>>
534
+ == Scope
535
+ <<iev,clause=1>>
420
536
 
421
- [bibliography]
422
- == Normative References
423
- * [[[iev,ISO 123:--]]] _Standard_
424
- INPUT
537
+ [bibliography]
538
+ == Normative References
539
+ * [[[iev,ISO 123:--]]] _Standard_
540
+ INPUT
425
541
  expect(File.read("test.err")).not_to include "undated reference ISO 123 should not contain specific elements"
426
- end
542
+ end
427
543
 
428
- it "warns of Non-reference in bibliography" do
429
- FileUtils.rm_f "test.err"
430
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
431
- #{VALIDATING_BLANK_HDR}
544
+ it "warns of Non-reference in bibliography" do
545
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
546
+ #{VALIDATING_BLANK_HDR}
432
547
 
433
- == Normative References
434
- * I am not a reference
435
- INPUT
548
+ == Normative References
549
+ * I am not a reference
550
+ INPUT
436
551
  expect(File.read("test.err")).to include "no anchor on reference"
437
- end
552
+ end
438
553
 
439
- it "warns of Non-ISO reference in Normative References" do
440
- FileUtils.rm_f "test.err"
441
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
442
- #{VALIDATING_BLANK_HDR}
554
+ it "warns of Non-ISO reference in Normative References" do
555
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
556
+ #{VALIDATING_BLANK_HDR}
443
557
 
444
- [bibliography]
445
- == Normative References
446
- * [[[XYZ,IESO 121]]] _Standard_
447
- INPUT
558
+ [bibliography]
559
+ == Normative References
560
+ * [[[XYZ,IESO 121]]] _Standard_
561
+ INPUT
448
562
  expect(File.read("test.err")).to include "non-ISO/IEC reference not expected as normative"
449
- end
563
+ end
450
564
 
451
- it "warns that Scope contains subclauses" do
452
- FileUtils.rm_f "test.err"
453
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
454
- #{VALIDATING_BLANK_HDR}
565
+ it "warns that Scope contains subclauses" do
566
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
567
+ #{VALIDATING_BLANK_HDR}
455
568
 
456
- == Scope
569
+ == Scope
457
570
 
458
- === Scope subclause
459
- INPUT
571
+ === Scope subclause
572
+ INPUT
460
573
  expect(File.read("test.err")).to include "Scope contains subclauses: should be succinct"
461
- end
462
-
574
+ end
463
575
 
464
- it "warns that Table should have title" do
465
- FileUtils.rm_f "test.err"
466
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
467
- #{VALIDATING_BLANK_HDR}
576
+ it "warns that Table should have title" do
577
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
578
+ #{VALIDATING_BLANK_HDR}
468
579
 
469
- |===
470
- |a |b |c
471
- |===
472
- INPUT
580
+ |===
581
+ |a |b |c
582
+ |===
583
+ INPUT
473
584
  expect(File.read("test.err")).to include "Table should have title"
474
- end
585
+ end
475
586
 
476
- it "gives Style warning if number not broken up in threes" do
477
- FileUtils.rm_f "test.err"
478
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
479
- #{VALIDATING_BLANK_HDR}
587
+ it "gives Style warning if number not broken up in threes" do
588
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
589
+ #{VALIDATING_BLANK_HDR}
480
590
 
481
- == Clause
482
- 12121
483
- INPUT
591
+ == Clause
592
+ 12121
593
+ INPUT
484
594
  expect(File.read("test.err")).to include "number not broken up in threes"
485
- end
595
+ end
486
596
 
487
- it "gives No style warning if number not broken up in threes is ISO reference" do
488
- FileUtils.rm_f "test.err"
489
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
490
- #{VALIDATING_BLANK_HDR}
597
+ it "gives No style warning if number not broken up in threes is ISO reference" do
598
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
599
+ #{VALIDATING_BLANK_HDR}
491
600
 
492
- == Clause
493
- ISO 12121
494
- INPUT
601
+ == Clause
602
+ ISO 12121
603
+ INPUT
495
604
  expect(File.read("test.err")).not_to include "number not broken up in threes"
496
- end
605
+ end
497
606
 
498
- it "Style warning if decimal point" do
499
- FileUtils.rm_f "test.err"
500
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
501
- #{VALIDATING_BLANK_HDR}
607
+ it "Style warning if decimal point" do
608
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
609
+ #{VALIDATING_BLANK_HDR}
502
610
 
503
- == Clause
504
- 8.1
505
- INPUT
611
+ == Clause
612
+ 8.1
613
+ INPUT
506
614
  expect(File.read("test.err")).to include "possible decimal point"
507
- end
615
+ end
508
616
 
509
- it "Style warning if billion used" do
510
- FileUtils.rm_f "test.err"
511
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
512
- #{VALIDATING_BLANK_HDR}
617
+ it "Style warning if billion used" do
618
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
619
+ #{VALIDATING_BLANK_HDR}
513
620
 
514
- == Clause
515
- "Billions" are a term of art.
516
- INPUT
621
+ == Clause
622
+ "Billions" are a term of art.
623
+ INPUT
517
624
  expect(File.read("test.err")).to include "ambiguous number"
518
- end
625
+ end
519
626
 
520
- it "Style warning if no space before percent sign" do
521
- FileUtils.rm_f "test.err"
522
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
523
- #{VALIDATING_BLANK_HDR}
627
+ it "Style warning if no space before percent sign" do
628
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
629
+ #{VALIDATING_BLANK_HDR}
524
630
 
525
- == Clause
526
- 95%
527
- INPUT
631
+ == Clause
632
+ 95%
633
+ INPUT
528
634
  expect(File.read("test.err")).to include "no space before percent sign"
529
- end
635
+ end
530
636
 
531
- it "Style warning if unbracketed tolerance before percent sign" do
532
- FileUtils.rm_f "test.err"
533
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
534
- #{VALIDATING_BLANK_HDR}
637
+ it "Style warning if unbracketed tolerance before percent sign" do
638
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
639
+ #{VALIDATING_BLANK_HDR}
535
640
 
536
- == Clause
537
- 95 ± 5 %
538
- INPUT
641
+ == Clause
642
+ 95 ± 5 %
643
+ INPUT
539
644
  expect(File.read("test.err")).to include "unbracketed tolerance before percent sign"
540
- end
645
+ end
541
646
 
542
- it "Style warning if dots in abbreviation" do
543
- FileUtils.rm_f "test.err"
544
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
545
- #{VALIDATING_BLANK_HDR}
647
+ it "Style warning if dots in abbreviation" do
648
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
649
+ #{VALIDATING_BLANK_HDR}
546
650
 
547
- == Clause
548
- r.p.m.
549
- INPUT
651
+ == Clause
652
+ r.p.m.
653
+ INPUT
550
654
  expect(File.read("test.err")).to include "no dots in abbreviation"
551
- end
655
+ end
552
656
 
553
- it "No Style warning if dots in abbreviation are e.g." do
554
- FileUtils.rm_f "test.err"
555
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
556
- #{VALIDATING_BLANK_HDR}
657
+ it "No Style warning if dots in abbreviation are e.g." do
658
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
659
+ #{VALIDATING_BLANK_HDR}
557
660
 
558
- == Clause
559
- e.g. 5
560
- INPUT
661
+ == Clause
662
+ e.g. 5
663
+ INPUT
561
664
  expect(File.read("test.err")).not_to include "no dots in abbreviation"
562
- end
665
+ end
563
666
 
564
- it "Style warning if ppm used" do
565
- FileUtils.rm_f "test.err"
566
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
567
- #{VALIDATING_BLANK_HDR}
667
+ it "Style warning if ppm used" do
668
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
669
+ #{VALIDATING_BLANK_HDR}
568
670
 
569
- == Clause
570
- 5 ppm
571
- INPUT
671
+ == Clause
672
+ 5 ppm
673
+ INPUT
572
674
  expect(File.read("test.err")).to include "language-specific abbreviation"
573
- end
675
+ end
574
676
 
575
- it "Style warning if space between number and degree" do
576
- FileUtils.rm_f "test.err"
577
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
578
- #{VALIDATING_BLANK_HDR}
677
+ it "Style warning if space between number and degree" do
678
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
679
+ #{VALIDATING_BLANK_HDR}
579
680
 
580
- == Clause
581
- 5 °
582
- INPUT
681
+ == Clause
682
+ 5 °
683
+ INPUT
583
684
  expect(File.read("test.err")).to include "space between number and degrees/minutes/seconds"
584
- end
685
+ end
585
686
 
586
- it "Style warning if no space between number and SI unit" do
587
- FileUtils.rm_f "test.err"
588
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
589
- #{VALIDATING_BLANK_HDR}
687
+ it "Style warning if no space between number and SI unit" do
688
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
689
+ #{VALIDATING_BLANK_HDR}
590
690
 
591
- == Clause
592
- A measurement of 5Bq was taken.
593
- INPUT
691
+ == Clause
692
+ A measurement of 5Bq was taken.
693
+ INPUT
594
694
  expect(File.read("test.err")).to include "no space between number and SI unit"
595
- end
695
+ end
596
696
 
597
- it "Style warning if mins used" do
598
- FileUtils.rm_f "test.err"
599
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
600
- #{VALIDATING_BLANK_HDR}
697
+ it "Style warning if mins used" do
698
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
699
+ #{VALIDATING_BLANK_HDR}
601
700
 
602
- == Clause
603
- 5 mins
604
- INPUT
701
+ == Clause
702
+ 5 mins
703
+ INPUT
605
704
  expect(File.read("test.err")).to include "non-standard unit"
606
- end
705
+ end
607
706
 
608
- # can't test: our asciidoc template won't allow this to be generated
609
- # it "Style warning if foreword contains subclauses" do
610
- # expect { Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true) }.to output(%r{non-standard unit}).to_stderr
707
+ # can't test: our asciidoc template won't allow this to be generated
708
+ # it "Style warning if foreword contains subclauses" do
709
+ # expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }
710
+ # .to output(%r{non-standard unit}).to_stderr
611
711
  # #{VALIDATING_BLANK_HDR}
612
- #
712
+ #
613
713
  # INPUT
614
- # end
615
-
616
- # can't test: we strip out any such content from Normative references preemptively
617
- #it "Style warning if Normative References contains subclauses" do
618
- #expect { Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true) }.to output(%r{normative references contains subclauses}).to_stderr
619
- ##{VALIDATING_BLANK_HDR}
620
- #
621
- #[bibliography]
714
+ # end
715
+
716
+ # can't test: we strip out any such content from Normative references preemptively
717
+ # it "Style warning if Normative References contains subclauses" do
718
+ # expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }
719
+ # .to output(%r{normative references contains subclauses}).to_stderr
720
+ # #{VALIDATING_BLANK_HDR}
721
+ #
722
+ # [bibliography]
622
723
  #== Normative References
623
724
  #
624
725
  #=== Subsection
625
- #INPUT
626
- #end
726
+ # INPUT
727
+ # end
627
728
 
628
- it "Style warning if two Symbols and Abbreviated Terms sections" do
629
- FileUtils.rm_f "test.err"
630
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
631
- #{VALIDATING_BLANK_HDR}
729
+ it "Style warning if two Symbols and Abbreviated Terms sections" do
730
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
731
+ #{VALIDATING_BLANK_HDR}
632
732
 
633
- == Terms and Abbreviations
733
+ == Terms and Abbreviations
634
734
 
635
- === Symbols and Abbreviated Terms
735
+ === Symbols and Abbreviated Terms
636
736
 
637
- == Symbols and Abbreviated Terms
638
- INPUT
737
+ == Symbols and Abbreviated Terms
738
+ INPUT
639
739
  expect(File.read("test.err")).to include "Only one Symbols and Abbreviated Terms section in the standard"
640
- end
740
+ end
641
741
 
642
- it "Style warning if Symbols and Abbreviated Terms contains extraneous matter" do
643
- FileUtils.rm_f "test.err"
644
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
645
- #{VALIDATING_BLANK_HDR}
742
+ it "Style warning if Symbols and Abbreviated Terms contains extraneous matter" do
743
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
744
+ #{VALIDATING_BLANK_HDR}
646
745
 
647
- == Symbols and Abbreviated Terms
746
+ == Symbols and Abbreviated Terms
648
747
 
649
- Paragraph
650
- INPUT
748
+ Paragraph
749
+ INPUT
651
750
  expect(File.read("test.err")).to include "Symbols and Abbreviated Terms can only contain a definition list"
652
- end
751
+ end
653
752
 
654
- it "Warning if missing foreword" do
655
- FileUtils.rm_f "test.err"
656
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
657
- #{VALIDATING_BLANK_HDR}
753
+ it "Warning if missing foreword" do
754
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
755
+ #{VALIDATING_BLANK_HDR}
658
756
 
659
- == Symbols and Abbreviated Terms
757
+ == Symbols and Abbreviated Terms
660
758
 
661
- Paragraph
662
- INPUT
759
+ Paragraph
760
+ INPUT
663
761
  expect(File.read("test.err")).to include "Initial section must be (content) Foreword"
664
- end
665
762
 
666
- it "Warning if do not start with scope or introduction" do
667
- FileUtils.rm_f "test.err"
668
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
669
- #{VALIDATING_BLANK_HDR}
670
- Foreword
763
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
764
+ = Document title
765
+ Author
766
+ :docfile: test.adoc
767
+ :nodoc:
768
+ :no-isobib:
769
+ :doctype: amendment
770
+
771
+ == Symbols and Abbreviated Terms
772
+
773
+ Paragraph
774
+ INPUT
775
+ expect(File.read("test.err")).not_to include "Initial section must be (content) Foreword"
776
+ end
777
+
778
+ it "Warning if do not start with scope or introduction" do
779
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
780
+ #{VALIDATING_BLANK_HDR}
781
+ Foreword
671
782
 
672
- == Symbols and Abbreviated Terms
783
+ == Symbols and Abbreviated Terms
673
784
 
674
- Paragraph
675
- INPUT
785
+ Paragraph
786
+ INPUT
676
787
  expect(File.read("test.err")).to include "Prefatory material must be followed by (clause) Scope"
677
- end
678
788
 
679
- it "Warning if introduction not followed by scope" do
680
- FileUtils.rm_f "test.err"
681
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
682
- #{VALIDATING_BLANK_HDR}
789
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
790
+ = Document title
791
+ Author
792
+ :docfile: test.adoc
793
+ :nodoc:
794
+ :no-isobib:
795
+ :doctype: amendment
683
796
 
684
- .Foreword
685
- Foreword
797
+ Foreword
686
798
 
687
- == Introduction
799
+ == Symbols and Abbreviated Terms
688
800
 
689
- == Symbols and Abbreviated Terms
801
+ Paragraph
802
+ INPUT
803
+ expect(File.read("test.err")).not_to include "Prefatory material must be followed by (clause) Scope"
804
+ end
690
805
 
691
- Paragraph
692
- INPUT
806
+ it "Warning if introduction not followed by scope" do
807
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
808
+ #{VALIDATING_BLANK_HDR}
809
+
810
+ .Foreword
811
+ Foreword
812
+
813
+ == Introduction
814
+
815
+ == Symbols and Abbreviated Terms
816
+
817
+ Paragraph
818
+ INPUT
693
819
  expect(File.read("test.err")).to include "Prefatory material must be followed by (clause) Scope"
694
- end
695
820
 
696
- it "Warning if normative references not followed by terms and definitions" do
697
- FileUtils.rm_f "test.err"
698
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
699
- #{VALIDATING_BLANK_HDR}
821
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
822
+ = Document title
823
+ Author
824
+ :docfile: test.adoc
825
+ :nodoc:
826
+ :no-isobib:
827
+ :doctype: amendment
828
+
829
+ .Foreword
830
+ Foreword
700
831
 
701
- .Foreword
702
- Foreword
832
+ == Introduction
833
+
834
+ == Symbols and Abbreviated Terms
835
+
836
+ Paragraph
837
+ INPUT
838
+ expect(File.read("test.err")).not_to include "Prefatory material must be followed by (clause) Scope"
839
+ end
840
+
841
+ it "Warning if normative references not followed by terms and definitions" do
842
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
843
+ #{VALIDATING_BLANK_HDR}
703
844
 
704
- == Scope
845
+ .Foreword
846
+ Foreword
705
847
 
706
- [bibliography]
707
- == Normative References
848
+ == Scope
708
849
 
709
- == Symbols and Abbreviated Terms
850
+ [bibliography]
851
+ == Normative References
710
852
 
711
- Paragraph
712
- INPUT
853
+ == Symbols and Abbreviated Terms
854
+
855
+ Paragraph
856
+ INPUT
713
857
  expect(File.read("test.err")).to include "Normative References must be followed by Terms and Definitions"
714
- end
715
858
 
716
- it "Warning if there are no clauses in the document" do
717
- FileUtils.rm_f "test.err"
718
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
719
- #{VALIDATING_BLANK_HDR}
859
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
860
+ = Document title
861
+ Author
862
+ :docfile: test.adoc
863
+ :nodoc:
864
+ :no-isobib:
865
+ :doctype: amendment
866
+
867
+ .Foreword
868
+ Foreword
869
+
870
+ == Scope
871
+
872
+ [bibliography]
873
+ == Normative References
874
+
875
+ == Symbols and Abbreviated Terms
876
+
877
+ Paragraph
878
+ INPUT
879
+ expect(File.read("test.err")).not_to include "Normative References must be followed by Terms and Definitions"
880
+ end
881
+
882
+ it "Warning if there are no clauses in the document" do
883
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
884
+ #{VALIDATING_BLANK_HDR}
720
885
 
721
- .Foreword
722
- Foreword
886
+ .Foreword
887
+ Foreword
723
888
 
724
- == Scope
889
+ == Scope
725
890
 
726
- [bibliography]
727
- == Normative References
891
+ [bibliography]
892
+ == Normative References
728
893
 
729
- == Terms and Definitions
894
+ == Terms and Definitions
730
895
 
731
- == Symbols and Abbreviated Terms
896
+ == Symbols and Abbreviated Terms
732
897
 
733
- INPUT
898
+ INPUT
734
899
  expect(File.read("test.err")).to include "Document must contain at least one clause"
735
- end
736
900
 
737
- it "Warning if scope occurs after Terms and Definitions" do
738
- FileUtils.rm_f "test.err"
739
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
740
- #{VALIDATING_BLANK_HDR}
901
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
902
+ = Document title
903
+ Author
904
+ :docfile: test.adoc
905
+ :nodoc:
906
+ :no-isobib:
907
+ :doctype: amendment
908
+
909
+ .Foreword
910
+ Foreword
911
+
912
+ == Scope
741
913
 
742
- .Foreword
743
- Foreword
914
+ [bibliography]
915
+ == Normative References
744
916
 
745
- == Scope
917
+ == Terms and Definitions
746
918
 
747
- [bibliography]
748
- == Normative References
919
+ == Symbols and Abbreviated Terms
749
920
 
750
- == Terms and Definitions
921
+ INPUT
922
+ expect(File.read("test.err")).not_to include "Document must contain at least one clause"
923
+ end
924
+
925
+ it "Warning if scope occurs after Terms and Definitions" do
926
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
927
+ #{VALIDATING_BLANK_HDR}
751
928
 
752
- == Clause
929
+ .Foreword
930
+ Foreword
753
931
 
754
- == Scope
932
+ == Scope
755
933
 
756
- INPUT
934
+ [bibliography]
935
+ == Normative References
936
+
937
+ == Terms and Definitions
938
+
939
+ == Clause
940
+
941
+ == Scope
942
+
943
+ INPUT
757
944
  expect(File.read("test.err")).to include "Scope must occur before Terms and Definitions"
758
- end
759
945
 
760
- it "Warning if Symbols and Abbreviated Terms does not occur immediately after Terms and Definitions" do
761
- FileUtils.rm_f "test.err"
762
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
763
- #{VALIDATING_BLANK_HDR}
946
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
947
+ = Document title
948
+ Author
949
+ :docfile: test.adoc
950
+ :nodoc:
951
+ :no-isobib:
952
+ :doctype: amendment
953
+
954
+ .Foreword
955
+ Foreword
956
+
957
+ == Scope
958
+
959
+ [bibliography]
960
+ == Normative References
961
+
962
+ == Terms and Definitions
963
+
964
+ == Clause
965
+
966
+ == Scope
967
+
968
+ INPUT
969
+ expect(File.read("test.err")).not_to include "Scope must occur before Terms and Definitions"
970
+ end
971
+
972
+ it "Warning if Symbols and Abbreviated Terms does not occur immediately after Terms and Definitions" do
973
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
974
+ #{VALIDATING_BLANK_HDR}
764
975
 
765
- .Foreword
766
- Foreword
976
+ .Foreword
977
+ Foreword
767
978
 
768
- == Scope
979
+ == Scope
769
980
 
770
- [bibliography]
771
- == Normative References
981
+ [bibliography]
982
+ == Normative References
772
983
 
773
- == Terms and Definitions
984
+ == Terms and Definitions
774
985
 
775
- == Clause
986
+ == Clause
776
987
 
777
- == Symbols and Abbreviated Terms
988
+ == Symbols and Abbreviated Terms
778
989
 
779
- INPUT
990
+ INPUT
780
991
  expect(File.read("test.err")).to include "Only annexes and references can follow clauses"
781
- end
782
992
 
783
- it "Warning if no normative references" do
784
- FileUtils.rm_f "test.err"
785
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
786
- #{VALIDATING_BLANK_HDR}
993
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
994
+ = Document title
995
+ Author
996
+ :docfile: test.adoc
997
+ :nodoc:
998
+ :no-isobib:
999
+ :doctype: amendment
1000
+
1001
+
1002
+ .Foreword
1003
+ Foreword
1004
+
1005
+ == Scope
1006
+
1007
+ [bibliography]
1008
+ == Normative References
1009
+
1010
+ == Terms and Definitions
787
1011
 
788
- .Foreword
789
- Foreword
1012
+ == Clause
1013
+
1014
+ == Symbols and Abbreviated Terms
1015
+
1016
+ INPUT
1017
+ expect(File.read("test.err")).not_to include "Only annexes and references can follow clauses"
1018
+ end
1019
+
1020
+ it "Warning if no normative references" do
1021
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1022
+ #{VALIDATING_BLANK_HDR}
790
1023
 
791
- == Scope
1024
+ .Foreword
1025
+ Foreword
792
1026
 
793
- == Terms and Definitions
1027
+ == Scope
794
1028
 
795
- == Clause
1029
+ == Terms and Definitions
796
1030
 
797
- [appendix]
798
- == Appendix A
1031
+ == Clause
799
1032
 
800
- [appendix]
801
- == Appendix B
1033
+ [appendix]
1034
+ == Appendix A
802
1035
 
803
- [appendix]
804
- == Appendix C
1036
+ [appendix]
1037
+ == Appendix B
805
1038
 
806
- INPUT
1039
+ [appendix]
1040
+ == Appendix C
1041
+
1042
+ INPUT
807
1043
  expect(File.read("test.err")).to include "Document must include (references) Normative References"
808
- end
809
1044
 
810
- it "Warning if final section is not named Bibliography" do
811
- FileUtils.rm_f "test.err"
812
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
813
- #{VALIDATING_BLANK_HDR}
1045
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1046
+ = Document title
1047
+ Author
1048
+ :docfile: test.adoc
1049
+ :nodoc:
1050
+ :no-isobib:
1051
+ :doctype: amendment
1052
+
1053
+ .Foreword
1054
+ Foreword
1055
+
1056
+ == Scope
1057
+
1058
+ == Terms and Definitions
1059
+
1060
+ == Clause
1061
+
1062
+ [appendix]
1063
+ == Appendix A
1064
+
1065
+ [appendix]
1066
+ == Appendix B
1067
+
1068
+ [appendix]
1069
+ == Appendix C
1070
+
1071
+ INPUT
1072
+ expect(File.read("test.err")).not_to include "Document must include (references) Normative References"
1073
+ end
1074
+
1075
+ it "Warning if final section is not named Bibliography" do
1076
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1077
+ #{VALIDATING_BLANK_HDR}
814
1078
 
815
- .Foreword
816
- Foreword
1079
+ .Foreword
1080
+ Foreword
817
1081
 
818
- == Scope
1082
+ == Scope
819
1083
 
820
- [bibliography]
821
- == Normative References
1084
+ [bibliography]
1085
+ == Normative References
822
1086
 
823
- == Terms and Definitions
1087
+ == Terms and Definitions
824
1088
 
825
- == Clause
1089
+ == Clause
826
1090
 
827
- [appendix]
828
- == Appendix A
1091
+ [appendix]
1092
+ == Appendix A
829
1093
 
830
- [appendix]
831
- == Appendix B
1094
+ [appendix]
1095
+ == Appendix B
832
1096
 
833
- [bibliography]
834
- == Bibliography
1097
+ [bibliography]
1098
+ == Bibliography
835
1099
 
836
- [bibliography]
837
- == Appendix C
1100
+ [bibliography]
1101
+ == Appendix C
838
1102
 
839
- INPUT
1103
+ INPUT
840
1104
  expect(File.read("test.err")).to include "There are sections after the final Bibliography"
841
- end
842
1105
 
843
- it "Warning if final section is not styled Bibliography" do
844
- FileUtils.rm_f "test.err"
845
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
846
- #{VALIDATING_BLANK_HDR}
1106
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1107
+ = Document title
1108
+ Author
1109
+ :docfile: test.adoc
1110
+ :nodoc:
1111
+ :no-isobib:
1112
+ :doctype: amendment
1113
+
1114
+ .Foreword
1115
+ Foreword
1116
+
1117
+ == Scope
847
1118
 
848
- .Foreword
849
- Foreword
1119
+ [bibliography]
1120
+ == Normative References
850
1121
 
851
- == Scope
1122
+ == Terms and Definitions
852
1123
 
853
- [bibliography]
854
- == Normative References
1124
+ == Clause
855
1125
 
856
- == Terms and Definitions
1126
+ [appendix]
1127
+ == Appendix A
857
1128
 
858
- == Clause
1129
+ [appendix]
1130
+ == Appendix B
859
1131
 
860
- [appendix]
861
- == Appendix A
1132
+ [bibliography]
1133
+ == Bibliography
1134
+
1135
+ [bibliography]
1136
+ == Appendix C
1137
+
1138
+ INPUT
1139
+ expect(File.read("test.err")).not_to include "There are sections after the final Bibliography"
1140
+ end
1141
+
1142
+ it "Warning if final section is not styled Bibliography" do
1143
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1144
+ #{VALIDATING_BLANK_HDR}
862
1145
 
863
- [appendix]
864
- == Appendix B
1146
+ .Foreword
1147
+ Foreword
865
1148
 
866
- == Bibliography
1149
+ == Scope
867
1150
 
868
- INPUT
1151
+ [bibliography]
1152
+ == Normative References
1153
+
1154
+ == Terms and Definitions
1155
+
1156
+ == Clause
1157
+
1158
+ [appendix]
1159
+ == Appendix A
1160
+
1161
+ [appendix]
1162
+ == Appendix B
1163
+
1164
+ == Bibliography
1165
+
1166
+ INPUT
869
1167
  expect(File.read("test.err")).to include "Section not marked up as [bibliography]"
870
- end
1168
+ end
1169
+
1170
+ it "Warning if final section is not styled Bibliography false" do
1171
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1172
+ = Document title
1173
+ Author
1174
+ :docfile: test.adoc
1175
+ :nodoc:
1176
+ :no-isobib:
1177
+ :doctype: amendment
1178
+
1179
+ .Foreword
1180
+ Foreword
871
1181
 
872
- it "Warning if English title intro and no French title intro" do
873
- FileUtils.rm_f "test.err"
874
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
875
- = Document title
876
- Author
877
- :docfile: test.adoc
878
- :nodoc:
879
- :title-intro-en: Title
880
- :no-isobib:
881
-
882
- INPUT
1182
+ == Scope
1183
+
1184
+ [bibliography]
1185
+ == Normative References
1186
+
1187
+ == Terms and Definitions
1188
+
1189
+ == Clause
1190
+
1191
+ [appendix]
1192
+ == Appendix A
1193
+
1194
+ [appendix]
1195
+ == Appendix B
1196
+
1197
+ == Bibliography
1198
+
1199
+ INPUT
1200
+ expect(File.read("test.err")).not_to include "Section not marked up as [bibliography]"
1201
+ end
1202
+
1203
+ it "Warning if English title intro and no French title intro" do
1204
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1205
+ = Document title
1206
+ Author
1207
+ :docfile: test.adoc
1208
+ :nodoc:
1209
+ :title-intro-en: Title
1210
+ :no-isobib:
1211
+
1212
+ INPUT
883
1213
  expect(File.read("test.err")).to include "No French Title Intro"
884
- end
1214
+ end
885
1215
 
886
- it "Warning if French title intro and no English title intro" do
887
- FileUtils.rm_f "test.err"
888
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
889
- = Document title
890
- Author
891
- :docfile: test.adoc
892
- :nodoc:
893
- :title-intro-fr: Title
894
- :no-isobib:
895
-
896
- INPUT
897
- expect(File.read("test.err")).to include "No English Title Intro"
898
- end
1216
+ it "Warning if French title intro and no English title intro" do
1217
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1218
+ = Document title
1219
+ Author
1220
+ :docfile: test.adoc
1221
+ :nodoc:
1222
+ :title-intro-fr: Title
1223
+ :no-isobib:
899
1224
 
1225
+ INPUT
1226
+ expect(File.read("test.err")).to include "No English Title Intro"
1227
+ end
900
1228
 
901
- it "Warning if English title and no French intro" do
902
- FileUtils.rm_f "test.err"
903
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
904
- = Document title
905
- Author
906
- :docfile: test.adoc
907
- :nodoc:
908
- :title-main-en: Title
909
- :no-isobib:
1229
+ it "Warning if English title and no French intro" do
1230
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1231
+ = Document title
1232
+ Author
1233
+ :docfile: test.adoc
1234
+ :nodoc:
1235
+ :title-main-en: Title
1236
+ :no-isobib:
910
1237
 
911
- INPUT
1238
+ INPUT
912
1239
  expect(File.read("test.err")).to include "No French Title"
913
- end
1240
+ end
1241
+
1242
+ it "Warning if French title and no English title" do
1243
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1244
+ = Document title
1245
+ Author
1246
+ :docfile: test.adoc
1247
+ :nodoc:
1248
+ :title-main-fr: Title
1249
+ :no-isobib:
914
1250
 
915
- it "Warning if French title and no English title" do
916
- FileUtils.rm_f "test.err"
917
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
918
- = Document title
919
- Author
920
- :docfile: test.adoc
921
- :nodoc:
922
- :title-main-fr: Title
923
- :no-isobib:
924
-
925
- INPUT
1251
+ INPUT
926
1252
  expect(File.read("test.err")).to include "No English Title"
927
- end
1253
+ end
928
1254
 
929
- it "Warning if English title part and no French title part" do
930
- FileUtils.rm_f "test.err"
931
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
932
- = Document title
933
- Author
934
- :docfile: test.adoc
935
- :nodoc:
936
- :title-part-en: Title
937
- :no-isobib:
938
-
939
- INPUT
1255
+ it "Warning if English title part and no French title part" do
1256
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1257
+ = Document title
1258
+ Author
1259
+ :docfile: test.adoc
1260
+ :nodoc:
1261
+ :title-part-en: Title
1262
+ :no-isobib:
1263
+
1264
+ INPUT
940
1265
  expect(File.read("test.err")).to include "No French Title Part"
941
- end
1266
+ end
942
1267
 
943
- it "Warning if French title part and no English title part" do
944
- FileUtils.rm_f "test.err"
945
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
946
- = Document title
947
- Author
948
- :docfile: test.adoc
949
- :nodoc:
950
- :title-part-fr: Title
951
- :no-isobib:
952
-
953
- INPUT
1268
+ it "Warning if French title part and no English title part" do
1269
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1270
+ = Document title
1271
+ Author
1272
+ :docfile: test.adoc
1273
+ :nodoc:
1274
+ :title-part-fr: Title
1275
+ :no-isobib:
1276
+
1277
+ INPUT
954
1278
  expect(File.read("test.err")).to include "No English Title Part"
955
- end
1279
+ end
956
1280
 
957
- it "Warning if non-IEC document with subpart" do
958
- FileUtils.rm_f "test.err"
959
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
960
- = Document title
961
- Author
962
- :docfile: test.adoc
963
- :nodoc:
964
- :docnumber: 10
965
- :partnumber: 1-1
966
- :publisher: ISO
967
- :no-isobib:
968
-
969
- INPUT
1281
+ it "Warning if non-IEC document with subpart" do
1282
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1283
+ = Document title
1284
+ Author
1285
+ :docfile: test.adoc
1286
+ :nodoc:
1287
+ :docnumber: 10
1288
+ :partnumber: 1-1
1289
+ :publisher: ISO
1290
+ :no-isobib:
1291
+
1292
+ INPUT
970
1293
  expect(File.read("test.err")).to include "Subpart defined on non-IEC document"
971
- end
1294
+ end
972
1295
 
973
- it "No warning if joint IEC/non-IEC document with subpart" do
974
- FileUtils.rm_f "test.err"
975
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
976
- = Document title
977
- Author
978
- :docfile: test.adoc
979
- :nodoc:
980
- :docnumber: 10
981
- :partnumber: 1-1
982
- :publisher: ISO,IEC
983
- :no-isobib:
984
-
985
- INPUT
1296
+ it "No warning if joint IEC/non-IEC document with subpart" do
1297
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1298
+ = Document title
1299
+ Author
1300
+ :docfile: test.adoc
1301
+ :nodoc:
1302
+ :docnumber: 10
1303
+ :partnumber: 1-1
1304
+ :publisher: ISO;IEC
1305
+ :no-isobib:
1306
+
1307
+ INPUT
986
1308
  expect(File.read("test.err")).not_to include "Subpart defined on non-IEC document"
987
- end
1309
+ end
1310
+
1311
+ it "Warning if main title contains document type" do
1312
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1313
+ = Document title
1314
+ Author
1315
+ :docfile: test.adoc
1316
+ :nodoc:
1317
+ :title-main-en: A Technical Specification on Widgets
1318
+ :no-isobib:
988
1319
 
989
- it "Warning if main title contains document type" do
990
- FileUtils.rm_f "test.err"
991
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
992
- = Document title
993
- Author
994
- :docfile: test.adoc
995
- :nodoc:
996
- :title-main-en: A Technical Specification on Widgets
997
- :no-isobib:
998
-
999
- INPUT
1320
+ INPUT
1000
1321
  expect(File.read("test.err")).to include "Main Title may name document type"
1001
- end
1322
+ end
1323
+
1324
+ it "Warning if intro title contains document type" do
1325
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1326
+ = Document title
1327
+ Author
1328
+ :docfile: test.adoc
1329
+ :nodoc:
1330
+ :title-intro-en: A Technical Specification on Widgets
1331
+ :no-isobib:
1002
1332
 
1003
- it "Warning if intro title contains document type" do
1004
- FileUtils.rm_f "test.err"
1005
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1006
- = Document title
1007
- Author
1008
- :docfile: test.adoc
1009
- :nodoc:
1010
- :title-intro-en: A Technical Specification on Widgets
1011
- :no-isobib:
1012
-
1013
- INPUT
1333
+ INPUT
1014
1334
  expect(File.read("test.err")).to include "Title Intro may name document type"
1015
- end
1335
+ end
1016
1336
 
1017
- it "Each first-level subclause must have a title" do
1018
- FileUtils.rm_f "test.err"
1019
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1020
- #{VALIDATING_BLANK_HDR}
1021
- == Clause
1337
+ it "Each first-level subclause must have a title" do
1338
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1339
+ #{VALIDATING_BLANK_HDR}
1340
+ == Clause
1022
1341
 
1023
- === {blank}
1024
- INPUT
1342
+ === {blank}
1343
+ INPUT
1025
1344
  expect(File.read("test.err")).to include "each first-level subclause must have a title"
1026
- end
1345
+ end
1027
1346
 
1028
- it "All subclauses must have a title, or none" do
1029
- FileUtils.rm_f "test.err"
1030
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1031
- #{VALIDATING_BLANK_HDR}
1032
- == Clause
1347
+ it "All subclauses must have a title, or none" do
1348
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1349
+ #{VALIDATING_BLANK_HDR}
1350
+ == Clause
1033
1351
 
1034
- === Subclause
1352
+ === Subclause
1035
1353
 
1036
- ==== {blank}
1354
+ ==== {blank}
1037
1355
 
1038
- ==== Subsubclause
1039
- INPUT
1356
+ ==== Subsubclause
1357
+ INPUT
1040
1358
  expect(File.read("test.err")).to include "all subclauses must have a title, or none"
1041
- end
1359
+ end
1042
1360
 
1043
- it "Warning if subclause is only child of its parent, or none" do
1044
- FileUtils.rm_f "test.err"
1045
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1046
- #{VALIDATING_BLANK_HDR}
1047
- == Clause
1361
+ it "Warning if subclause is only child of its parent, or none" do
1362
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1363
+ #{VALIDATING_BLANK_HDR}
1364
+ == Clause
1048
1365
 
1049
- === Subclause
1366
+ === Subclause
1050
1367
 
1051
- INPUT
1368
+ INPUT
1052
1369
  expect(File.read("test.err")).to include "subclause is only child"
1053
- end
1370
+ end
1371
+
1372
+ it "Warning if invalid technical committee type" do
1373
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1374
+ = Document title
1375
+ Author
1376
+ :docfile: test.adoc
1377
+ :nodoc:
1378
+ :technical-committee-type: X
1379
+ :no-isobib:
1054
1380
 
1055
- it "Warning if invalid technical committee type" do
1056
- FileUtils.rm_f "test.err"
1057
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1058
- = Document title
1059
- Author
1060
- :docfile: test.adoc
1061
- :nodoc:
1062
- :technical-committee-type: X
1063
- :no-isobib:
1064
-
1065
- INPUT
1381
+ INPUT
1066
1382
  expect(File.read("test.err")).to include "invalid technical committee type"
1067
- end
1383
+ end
1384
+
1385
+ it "Warning if invalid subcommittee type" do
1386
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1387
+ = Document title
1388
+ Author
1389
+ :docfile: test.adoc
1390
+ :nodoc:
1391
+ :subcommittee-type: X
1392
+ :no-isobib:
1068
1393
 
1069
- it "Warning if invalid subcommittee type" do
1070
- FileUtils.rm_f "test.err"
1071
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1072
- = Document title
1073
- Author
1074
- :docfile: test.adoc
1075
- :nodoc:
1076
- :subcommittee-type: X
1077
- :no-isobib:
1078
-
1079
- INPUT
1394
+ INPUT
1080
1395
  expect(File.read("test.err")).to include "invalid subcommittee type"
1081
- end
1396
+ end
1397
+
1398
+ it "Warning if invalid subcommittee type" do
1399
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1400
+ = Document title
1401
+ Author
1402
+ :docfile: test.adoc
1403
+ :nodoc:
1404
+ :subcommittee-type: X
1405
+ :no-isobib:
1082
1406
 
1083
- it "Warning if invalid subcommittee type" do
1084
- FileUtils.rm_f "test.err"
1085
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1086
- = Document title
1087
- Author
1088
- :docfile: test.adoc
1089
- :nodoc:
1090
- :subcommittee-type: X
1091
- :no-isobib:
1092
-
1093
- INPUT
1407
+ INPUT
1094
1408
  expect(File.read("test.err")).to include "invalid subcommittee type"
1095
- end
1409
+ end
1096
1410
 
1097
- it "Warning if 'see' crossreference points to normative section" do
1098
- FileUtils.rm_f "test.err"
1099
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1100
- #{VALIDATING_BLANK_HDR}
1101
- [[terms]]
1102
- == Terms and Definitions
1411
+ it "Warning if 'see' crossreference points to normative section" do
1412
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1413
+ #{VALIDATING_BLANK_HDR}
1414
+ [[terms]]
1415
+ == Terms and Definitions
1103
1416
 
1104
- == Clause
1105
- See <<terms>>
1106
- INPUT
1417
+ == Clause
1418
+ See <<terms>>
1419
+ INPUT
1107
1420
  expect(File.read("test.err")).to include "'see terms' is pointing to a normative section"
1108
- end
1421
+ end
1109
1422
 
1110
- it "Warning if 'see' reference points to normative reference" do
1111
- FileUtils.rm_f "test.err"
1112
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1113
- #{VALIDATING_BLANK_HDR}
1114
- [bibliography]
1115
- == Normative References
1116
- * [[[terms,ISO 1]]] _References_
1117
-
1118
- == Clause
1119
- See <<terms>>
1120
- INPUT
1423
+ it "Warning if 'see' reference points to normative reference" do
1424
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1425
+ #{VALIDATING_BLANK_HDR}
1426
+ [bibliography]
1427
+ == Normative References
1428
+ * [[[terms,ISO 1]]] _References_
1429
+
1430
+ == Clause
1431
+ See <<terms>>
1432
+ INPUT
1121
1433
  expect(File.read("test.err")).to include "is pointing to a normative reference"
1122
- end
1434
+ end
1123
1435
 
1124
- it "Warning if term definition starts with article" do
1125
- FileUtils.rm_f "test.err"
1126
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1127
- #{VALIDATING_BLANK_HDR}
1128
- == Terms and Definitions
1436
+ it "Warning if term definition starts with article" do
1437
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1438
+ #{VALIDATING_BLANK_HDR}
1439
+ == Terms and Definitions
1129
1440
 
1130
- === Term
1441
+ === Term
1131
1442
 
1132
- The definition of a term is a part of the specialized vocabulary of a particular field
1133
- INPUT
1443
+ The definition of a term is a part of the specialized vocabulary of a particular field
1444
+ INPUT
1134
1445
  expect(File.read("test.err")).to include "term definition starts with article"
1135
- end
1446
+ end
1136
1447
 
1137
- it "Warning if term definition ends with period" do
1138
- FileUtils.rm_f "test.err"
1139
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1140
- #{VALIDATING_BLANK_HDR}
1141
- == Terms and Definitions
1448
+ it "Warning if term definition ends with period" do
1449
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1450
+ #{VALIDATING_BLANK_HDR}
1451
+ == Terms and Definitions
1142
1452
 
1143
- === Term
1453
+ === Term
1144
1454
 
1145
- Part of the specialized vocabulary of a particular field.
1146
- INPUT
1455
+ Part of the specialized vocabulary of a particular field.
1456
+ INPUT
1147
1457
  expect(File.read("test.err")).to include "term definition ends with period"
1148
- end
1458
+ end
1149
1459
 
1150
- it "validates document against ISO XML schema" do
1151
- FileUtils.rm_f "test.err"
1152
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1153
- #{VALIDATING_BLANK_HDR}
1460
+ it "validates document against ISO XML schema" do
1461
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1462
+ #{VALIDATING_BLANK_HDR}
1154
1463
 
1155
- [align=mid-air]
1156
- Para
1157
- INPUT
1464
+ [align=mid-air]
1465
+ Para
1466
+ INPUT
1158
1467
  expect(File.read("test.err")).to include 'value of attribute "align" is invalid; must be equal to'
1159
- end
1468
+ end
1160
1469
 
1161
- it "Warn if more than 7 levels of subclause" do
1162
- FileUtils.rm_f "test.err"
1163
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1164
- = Document title
1165
- Author
1166
- :docfile: test.adoc
1167
- :nodoc:
1168
- :no-isobib:
1169
- :language: fr
1470
+ it "Warn if more than 7 levels of subclause" do
1471
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1472
+ = Document title
1473
+ Author
1474
+ :docfile: test.adoc
1475
+ :nodoc:
1476
+ :no-isobib:
1477
+ :language: fr
1170
1478
 
1171
- == Clause
1479
+ == Clause
1172
1480
 
1173
- === Clause
1481
+ === Clause
1174
1482
 
1175
- ==== Clause
1483
+ ==== Clause
1176
1484
 
1177
- ===== Clause
1485
+ ===== Clause
1178
1486
 
1179
- ====== Clause
1487
+ ====== Clause
1180
1488
 
1181
- [level=6]
1182
- ====== Clause
1489
+ [level=6]
1490
+ ====== Clause
1183
1491
 
1184
- [level=7]
1185
- ====== Clause
1492
+ [level=7]
1493
+ ====== Clause
1186
1494
 
1187
- [level=8]
1188
- ====== Clause
1495
+ [level=8]
1496
+ ====== Clause
1189
1497
 
1190
- INPUT
1498
+ INPUT
1191
1499
  expect(File.read("test.err")).to include "Exceeds the maximum clause depth of 7"
1192
- end
1500
+ end
1193
1501
 
1194
- it "Do not warn if not more than 7 levels of subclause" do
1195
- FileUtils.rm_f "test.err"
1196
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1197
- = Document title
1198
- Author
1199
- :docfile: test.adoc
1200
- :nodoc:
1201
- :no-isobib:
1202
- :language: fr
1502
+ it "Do not warn if not more than 7 levels of subclause" do
1503
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1504
+ = Document title
1505
+ Author
1506
+ :docfile: test.adoc
1507
+ :nodoc:
1508
+ :no-isobib:
1509
+ :language: fr
1203
1510
 
1204
- == Clause
1511
+ == Clause
1205
1512
 
1206
- === Clause
1513
+ === Clause
1207
1514
 
1208
- ==== Clause
1515
+ ==== Clause
1209
1516
 
1210
- ===== Clause
1517
+ ===== Clause
1211
1518
 
1212
- ====== Clause
1519
+ ====== Clause
1213
1520
 
1214
- [level=6]
1215
- ====== Clause
1521
+ [level=6]
1522
+ ====== Clause
1216
1523
 
1217
- [level=7]
1218
- ====== Clause
1524
+ [level=7]
1525
+ ====== Clause
1219
1526
 
1220
- INPUT
1527
+ INPUT
1221
1528
  expect(File.read("test.err")).not_to include "exceeds the maximum clause depth of 7"
1222
- end
1529
+ end
1223
1530
 
1224
- it "Warn if term citation in Terms & Definitions not preceded with italicised term" do
1225
- FileUtils.rm_f "test.err"
1226
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1227
- #{VALIDATING_BLANK_HDR}
1228
- == Terms and Definitions
1531
+ it "Warn if term citation in Terms & Definitions not preceded with italicised term" do
1532
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1533
+ #{VALIDATING_BLANK_HDR}
1534
+ == Terms and Definitions
1229
1535
 
1230
- [[term]]
1231
- === Term
1536
+ [[term]]
1537
+ === Term
1232
1538
 
1233
- The definition of a term (<<term>>) is a part of the specialized vocabulary of a particular field
1234
- INPUT
1539
+ The definition of a term (<<term>>) is a part of the specialized vocabulary of a particular field
1540
+ INPUT
1235
1541
  expect(File.read("test.err")).to include "term citation not preceded with italicised term"
1236
- end
1237
-
1238
- it "Warn if an undated reference has no associated footnote" do
1239
- FileUtils.rm_f "test.err"
1240
- Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true)
1241
- #{VALIDATING_BLANK_HDR}
1242
-
1243
- [bibliography]
1244
- == Bibliography
1245
- * [[[ISO8,ISO 8:--]]], _Title_
1246
- INPUT
1247
- expect(File.read("test.err")).to include "Reference ISO8 does not have an associated footnote indicating unpublished status"
1248
- end
1542
+ end
1249
1543
 
1544
+ it "Warn if an undated reference has no associated footnote" do
1545
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1546
+ #{VALIDATING_BLANK_HDR}
1250
1547
 
1548
+ [bibliography]
1549
+ == Bibliography
1550
+ * [[[ISO8,ISO 8:--]]], _Title_
1551
+ INPUT
1552
+ expect(File.read("test.err")).to include \
1553
+ "Reference ISO8 does not have an associated footnote indicating unpublished status"
1554
+ end
1251
1555
  end