metanorma-iso 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/lib/isodoc/iso/html/header-dis.html +111 -29
  3. data/lib/isodoc/iso/html/isodoc-dis.css +65 -64
  4. data/lib/isodoc/iso/html/isodoc-dis.scss +65 -64
  5. data/lib/isodoc/iso/html/style-human.css +1 -2
  6. data/lib/isodoc/iso/html/style-human.scss +0 -1
  7. data/lib/isodoc/iso/html/style-iso.css +1 -2
  8. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  9. data/lib/isodoc/iso/html/wordstyle-dis.css +10 -4
  10. data/lib/isodoc/iso/html/wordstyle-dis.scss +10 -4
  11. data/lib/isodoc/iso/i18n-en.yaml +4 -4
  12. data/lib/isodoc/iso/iso.amendment.xsl +205 -37
  13. data/lib/isodoc/iso/iso.international-standard.xsl +205 -37
  14. data/lib/isodoc/iso/presentation_bibdata.rb +13 -9
  15. data/lib/isodoc/iso/presentation_xml_convert.rb +5 -3
  16. data/lib/isodoc/iso/word_convert.rb +6 -4
  17. data/lib/isodoc/iso/word_dis_cleanup.rb +24 -3
  18. data/lib/isodoc/iso/word_dis_convert.rb +4 -1
  19. data/lib/metanorma/iso/base.rb +2 -1
  20. data/lib/metanorma/iso/biblio.rng +5 -0
  21. data/lib/metanorma/iso/isodoc.rng +46 -12
  22. data/lib/metanorma/iso/version.rb +1 -1
  23. data/metanorma-iso.gemspec +5 -2
  24. metadata +4 -87
  25. data/.github/workflows/automerge.yml +0 -31
  26. data/.github/workflows/rake.yml +0 -15
  27. data/.github/workflows/release.yml +0 -24
  28. data/.github/workflows/ubuntu.yml +0 -41
  29. data/Rakefile +0 -8
  30. data/bin/rspec +0 -17
  31. data/spec/assets/header.html +0 -7
  32. data/spec/assets/html.css +0 -2
  33. data/spec/assets/htmlcover.html +0 -4
  34. data/spec/assets/htmlintro.html +0 -5
  35. data/spec/assets/i18n.yaml +0 -2
  36. data/spec/assets/iso.adoc +0 -10
  37. data/spec/assets/iso.headless.html +0 -33
  38. data/spec/assets/iso.xml +0 -71
  39. data/spec/assets/rice_image1.png +0 -0
  40. data/spec/assets/scripts.html +0 -3
  41. data/spec/assets/std.css +0 -2
  42. data/spec/assets/word.css +0 -2
  43. data/spec/assets/wordcover.html +0 -3
  44. data/spec/assets/wordintro.html +0 -4
  45. data/spec/examples/103_01_02.html +0 -247
  46. data/spec/examples/english.yaml +0 -69
  47. data/spec/examples/iso_123_.xml +0 -45
  48. data/spec/examples/iso_123_all_parts.xml +0 -45
  49. data/spec/examples/iso_123_no_year_note.xml +0 -46
  50. data/spec/examples/iso_124_.xml +0 -41
  51. data/spec/examples/iso_216_.xml +0 -47
  52. data/spec/examples/iso_iec_12382_.xml +0 -48
  53. data/spec/examples/rice.adoc +0 -714
  54. data/spec/examples/rice.preview.html +0 -1870
  55. data/spec/examples/rice.sh +0 -4
  56. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  57. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  58. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  59. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  60. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  61. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  62. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  63. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  64. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  65. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  66. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  67. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  68. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  69. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  70. data/spec/examples/rice_img/rice_image1.png +0 -0
  71. data/spec/examples/rice_img/rice_image2.png +0 -0
  72. data/spec/examples/rice_img/rice_image3_1.png +0 -0
  73. data/spec/examples/rice_img/rice_image3_2.png +0 -0
  74. data/spec/examples/rice_img/rice_image3_3.png +0 -0
  75. data/spec/isodoc/amd_spec.rb +0 -986
  76. data/spec/isodoc/blocks_spec.rb +0 -1174
  77. data/spec/isodoc/i18n_spec.rb +0 -1579
  78. data/spec/isodoc/inline_spec.rb +0 -1060
  79. data/spec/isodoc/iso_spec.rb +0 -255
  80. data/spec/isodoc/metadata_spec.rb +0 -701
  81. data/spec/isodoc/postproc_spec.rb +0 -1089
  82. data/spec/isodoc/ref_spec.rb +0 -439
  83. data/spec/isodoc/section_spec.rb +0 -998
  84. data/spec/isodoc/table_spec.rb +0 -420
  85. data/spec/isodoc/terms_spec.rb +0 -314
  86. data/spec/isodoc/word_dis_spec.rb +0 -2064
  87. data/spec/isodoc/xref_spec.rb +0 -1747
  88. data/spec/metanorma/amd_spec.rb +0 -724
  89. data/spec/metanorma/base_spec.rb +0 -1384
  90. data/spec/metanorma/blank_spec.rb +0 -38
  91. data/spec/metanorma/blocks_spec.rb +0 -624
  92. data/spec/metanorma/cleanup_spec.rb +0 -1645
  93. data/spec/metanorma/inline_spec.rb +0 -203
  94. data/spec/metanorma/lists_spec.rb +0 -197
  95. data/spec/metanorma/macros_spec.rb +0 -99
  96. data/spec/metanorma/processor_spec.rb +0 -161
  97. data/spec/metanorma/refs_spec.rb +0 -672
  98. data/spec/metanorma/section_spec.rb +0 -492
  99. data/spec/metanorma/table_spec.rb +0 -329
  100. data/spec/metanorma/validate_spec.rb +0 -2153
  101. data/spec/relaton/render_spec.rb +0 -568
  102. data/spec/requirements/requirement_components_spec.rb +0 -610
  103. data/spec/requirements/requirements_spec.rb +0 -1596
  104. data/spec/requirements/xref_spec.rb +0 -1211
  105. data/spec/spec_helper.rb +0 -313
  106. data/spec/vcr_cassettes/docrels.yml +0 -385
  107. data/spec/vcr_cassettes/withdrawn_iso.yml +0 -295
@@ -1,2153 +0,0 @@
1
- require "spec_helper"
2
- require "fileutils"
3
-
4
- RSpec.describe Metanorma::ISO do
5
- context "when xref_error.adoc compilation" do
6
- it "generates error file" do
7
- FileUtils.rm_f "xref_error.err"
8
- File.write("xref_error.adoc", <<~"CONTENT")
9
- = X
10
- A
11
-
12
- == Clause
13
-
14
- <<a,b>>
15
- CONTENT
16
-
17
- expect do
18
- mock_pdf
19
- Metanorma::Compile
20
- .new
21
- .compile("xref_error.adoc", type: "iso", no_install_fonts: true)
22
- end.to(change { File.exist?("xref_error.err") }
23
- .from(false).to(true))
24
- end
25
- end
26
-
27
- it "Warns of image names not compliant with DRG" do
28
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
29
- = Document title
30
- Author
31
- :docfile: test.adoc
32
- :nodoc:
33
- :no-isobib:
34
- :docnumber: 1000
35
- :partnumber: 1
36
- :edition: 2
37
- :amendment-number: 3
38
- :data-uri-image: false
39
-
40
- .Split-it-right sample divider
41
- image::spec/examples/rice_img/rice_image1.png[]
42
- image::spec/examples/rice_img/SL1000-1_ed2amd3fig1.png[]
43
- image::spec/examples/rice_img/1001_ed2amd3fig1.png[]
44
- image::spec/examples/rice_img/ISO_1213_1.png[]
45
- image::spec/examples/rice_img/1000-1_ed2amd3figA.png[]
46
-
47
- |===
48
- |a |b
49
-
50
- a|image::spec/examples/rice_img/1000-1_ed2amd3figTab1.png[]
51
- a|image::spec/examples/rice_img/1000-1_ed2amd3fig2.png[]
52
- |===
53
-
54
- image::spec/examples/rice_img/1000-1_ed2amd3figTab2.png[]
55
-
56
- image::spec/examples/rice_img/1000-1_ed2amd3figA1.png[]
57
- image::spec/examples/rice_img/1000-1_ed2amd3fig1a.png[]
58
-
59
- .Stages of gelatinization
60
- ====
61
- image::spec/examples/rice_img/1000-1_ed2amd3fig1b.png[]
62
-
63
- image::spec/examples/rice_img/1000-1_ed2amd3fig4.png[]
64
- ====
65
-
66
- image::spec/examples/rice_img/1000-1_ed2amd3fig5_f.png[]
67
-
68
- [appendix]
69
- == Annex
70
- image::spec/examples/rice_img/1000-1_ed2amd3figA2.png[]
71
- image::spec/examples/rice_img/1000-1_ed2amd3fig3.png[]
72
-
73
- INPUT
74
- expect(File.read("test.err")).to include \
75
- "image name spec/examples/rice_img/rice_image1.png does not match " \
76
- "DRG requirements: expect 1000-1_ed2amd3fig"
77
- expect(File.read("test.err")).to include \
78
- "image name spec/examples/rice_img/1001_ed2amd3fig1.png does not " \
79
- "match DRG requirements: " \
80
- "expect 1000-1_ed2amd3fig"
81
- expect(File.read("test.err")).not_to include \
82
- "image name spec/examples/rice_img/SL1000-1_ed2amd3fig1.png does not " \
83
- "match DRG requirements: " \
84
- "expect 1000-1_ed2amd3fig"
85
- expect(File.read("test.err")).not_to include \
86
- "image name spec/examples/rice_img/ISO_1213_1.png does not match DRG " \
87
- "requirements: expect 1000-1_ed2amd3fig"
88
- expect(File.read("test.err")).to include \
89
- "image name spec/examples/rice_img/1000-1_ed2amd3figA.png does not " \
90
- "match DRG requirements"
91
- expect(File.read("test.err")).not_to include \
92
- "image name spec/examples/rice_img/1000-1_ed2amd3figTab1.png does " \
93
- "not match DRG requirements"
94
- expect(File.read("test.err")).not_to include \
95
- "image name spec/examples/rice_img/1000-1_ed2amd3figTab1.png is " \
96
- "under a table but is not so labelled"
97
- expect(File.read("test.err")).to include \
98
- "image name spec/examples/rice_img/1000-1_ed2amd3fig2.png is under " \
99
- "a table but is not so labelled"
100
- expect(File.read("test.err")).to include \
101
- "image name spec/examples/rice_img/1000-1_ed2amd3figTab2.png is " \
102
- "labelled as under a table but is not"
103
- expect(File.read("test.err")).not_to include \
104
- "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png is " \
105
- "labelled as under a table but is not"
106
- expect(File.read("test.err")).not_to include \
107
- "image name spec/examples/rice_img/1000-1_ed2amd3figA2.png is " \
108
- "under an annex but is not so labelled"
109
- expect(File.read("test.err")).to include \
110
- "image name spec/examples/rice_img/1000-1_ed2amd3fig3.png is " \
111
- "under an annex but is not so labelled"
112
- expect(File.read("test.err")).to include \
113
- "image name spec/examples/rice_img/1000-1_ed2amd3figA1.png is " \
114
- "labelled as under an annex but is not"
115
- expect(File.read("test.err")).not_to include \
116
- "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png is " \
117
- "labelled as under an annex but is not"
118
- expect(File.read("test.err")).not_to include \
119
- "image name spec/examples/rice_img/1000-1_ed2amd3fig1b.png has a " \
120
- "subfigure letter but is not a subfigure"
121
- expect(File.read("test.err")).to include \
122
- "image name spec/examples/rice_img/1000-1_ed2amd3fig4.png does not " \
123
- "have a subfigure letter but is a subfigure"
124
- expect(File.read("test.err")).to include \
125
- "image name spec/examples/rice_img/1000-1_ed2amd3fig1a.png has a " \
126
- "subfigure letter but is not a subfigure"
127
- expect(File.read("test.err")).not_to include \
128
- "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png has a " \
129
- "subfigure letter but is not a subfigure"
130
- expect(File.read("test.err")).to include \
131
- "image name spec/examples/rice_img/1000-1_ed2amd3fig5_f.png expected " \
132
- "to have suffix _e"
133
- expect(File.read("test.err")).not_to include \
134
- "image name spec/examples/rice_img/1000-1_ed2amd3fig1.png expected " \
135
- "to have suffix _e"
136
- end
137
-
138
- context "Warns of missing scope" do
139
- it "Scope clause missing" do
140
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
141
- = Document title
142
- Author
143
- :docfile: test.adoc
144
- :nodoc:
145
- :no-isobib:
146
- :doctype: pizza
147
-
148
- text
149
- INPUT
150
-
151
- expect(File.read("test.err")).to include "Scope clause missing"
152
- end
153
-
154
- it "Scope clause not missing if supplied" do
155
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
156
- = Document title
157
- Author
158
- :docfile: test.adoc
159
- :nodoc:
160
- :no-isobib:
161
- :doctype: pizza
162
-
163
- == Scope
164
- INPUT
165
- expect(File.read("test.err")).not_to include "Scope clause missing"
166
- end
167
-
168
- it "Scope clause not missing in amendments" do
169
- FileUtils.rm_f "test.err"
170
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
171
- = Document title
172
- Author
173
- :docfile: test.adoc
174
- :nodoc:
175
- :no-isobib:
176
- :doctype: amendment
177
-
178
- text
179
- INPUT
180
- expect(File.read("test.err")).not_to include "Scope clause missing"
181
- end
182
- end
183
-
184
- context "Warns of missing normative references" do
185
- it "Normative references missing" do
186
- FileUtils.rm_f "test.err"
187
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
188
- = Document title
189
- Author
190
- :docfile: test.adoc
191
- :nodoc:
192
- :no-isobib:
193
- :doctype: pizza
194
-
195
- text
196
- INPUT
197
- expect(File.read("test.err")).to include "Normative references missing"
198
- end
199
-
200
- it "Normative references not missing if supplied" do
201
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
202
- = Document title
203
- Author
204
- :docfile: test.adoc
205
- :nodoc:
206
- :no-isobib:
207
- :doctype: pizza
208
-
209
- [bibliography]
210
- == Normative references
211
- INPUT
212
- expect(File.read("test.err"))
213
- .not_to include "Normative references missing"
214
- end
215
-
216
- it "Normative references not missing in amendments" do
217
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
218
- = Document title
219
- Author
220
- :docfile: test.adoc
221
- :nodoc:
222
- :no-isobib:
223
- :doctype: amendment
224
-
225
- text
226
- INPUT
227
- expect(File.read("test.err"))
228
- .not_to include "Normative references missing"
229
- end
230
- end
231
-
232
- context "Warns of missing terms & definitions" do
233
- it "Terms & definitions missing" do
234
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
235
- = Document title
236
- Author
237
- :docfile: test.adoc
238
- :nodoc:
239
- :no-isobib:
240
- :doctype: pizza
241
-
242
- text
243
- INPUT
244
- expect(File.read("test.err")).to include "Terms & definitions missing"
245
- end
246
-
247
- it "Terms & definitions not missing if supplied" do
248
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
249
- = Document title
250
- Author
251
- :docfile: test.adoc
252
- :nodoc:
253
- :no-isobib:
254
- :doctype: pizza
255
-
256
- == Terms and definitions
257
- === Term 1
258
- INPUT
259
- expect(File.read("test.err")).not_to include "Terms & definitions missing"
260
- end
261
-
262
- it "Terms & definitions not missing in amendment" do
263
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
264
- = Document title
265
- Author
266
- :docfile: test.adoc
267
- :nodoc:
268
- :no-isobib:
269
- :doctype: amendment
270
-
271
- text
272
- INPUT
273
- expect(File.read("test.err")).not_to include "Terms & definitions missing"
274
- end
275
- end
276
-
277
- it "Warns of illegal doctype" do
278
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
279
- = Document title
280
- Author
281
- :docfile: test.adoc
282
- :nodoc:
283
- :no-isobib:
284
- :doctype: pizza
285
-
286
- text
287
- INPUT
288
- expect(File.read("test.err"))
289
- .to include "pizza is not a recognised document type"
290
- end
291
-
292
- it "Warns of illegal script" do
293
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
294
- = Document title
295
- Author
296
- :docfile: test.adoc
297
- :nodoc:
298
- :no-isobib:
299
- :script: pizza
300
-
301
- text
302
- INPUT
303
- expect(File.read("test.err")).to include "pizza is not a recognised script"
304
- end
305
-
306
- it "Warns of illegal stage" do
307
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
308
- = Document title
309
- Author
310
- :docfile: test.adoc
311
- :nodoc:
312
- :no-isobib:
313
- :status: pizza
314
-
315
- text
316
- INPUT
317
- expect(File.read("test.err")).to include "pizza is not a recognised stage"
318
- end
319
-
320
- it "Warns of illegal substage" do
321
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
322
- = Document title
323
- Author
324
- :docfile: test.adoc
325
- :nodoc:
326
- :no-isobib:
327
- :status: 60
328
- :docsubstage: pizza
329
-
330
- text
331
- INPUT
332
- expect(File.read("test.err"))
333
- .to include "pizza is not a recognised substage"
334
- end
335
-
336
- it "Warns of illegal iteration" do
337
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
338
- = Document title
339
- Author
340
- :docfile: test.adoc
341
- :nodoc:
342
- :no-isobib:
343
- :status: 60
344
- :iteration: pizza
345
-
346
- text
347
- INPUT
348
- expect(File.read("test.err"))
349
- .to include "pizza is not a recognised iteration"
350
- end
351
-
352
- it "Warns of illegal script" do
353
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
354
- = Document title
355
- Author
356
- :docfile: test.adoc
357
- :nodoc:
358
- :no-isobib:
359
- :script: pizza
360
-
361
- text
362
- INPUT
363
- expect(File.read("test.err")).to include "pizza is not a recognised script"
364
- end
365
-
366
- it "warns that technical report may contain requirement" do
367
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
368
- = Document title
369
- Author
370
- :docfile: test.adoc
371
- :nodoc:
372
- :no-isobib:
373
- :doctype: technical-report
374
-
375
- == Random clause
376
-
377
- The widget is required not to be larger than 15 cm.
378
- INPUT
379
- expect(File.read("test.err"))
380
- .to include "Technical Report clause may contain requirement"
381
- end
382
-
383
- it "warns that introduction may contain requirement" do
384
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
385
- #{VALIDATING_BLANK_HDR}
386
- == Introduction
387
-
388
- The widget is required not to be larger than 15 cm.
389
- INPUT
390
- expect(File.read("test.err"))
391
- .to include "Introduction may contain requirement"
392
- end
393
-
394
- it "warns that foreword may contain recommendation" do
395
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
396
- #{VALIDATING_BLANK_HDR}
397
-
398
- It is not recommended that widgets should be larger than 15 cm.
399
-
400
- == Clause
401
- INPUT
402
- expect(File.read("test.err"))
403
- .to include "Foreword may contain recommendation"
404
- end
405
-
406
- it "warns that foreword may contain permission" do
407
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
408
- #{VALIDATING_BLANK_HDR}
409
-
410
- No widget is required to be larger than 15 cm.
411
-
412
- == Clause
413
- INPUT
414
- expect(File.read("test.err")).to include "Foreword may contain permission"
415
- end
416
-
417
- it "warns that scope may contain recommendation" do
418
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
419
- #{VALIDATING_BLANK_HDR}
420
-
421
- == Scope
422
- It is not recommended that widgets should be larger than 15 cm.
423
- INPUT
424
- expect(File.read("test.err")).to include "Scope may contain recommendation"
425
- end
426
-
427
- it "warns that definition may contain requirement" do
428
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
429
- #{VALIDATING_BLANK_HDR}
430
-
431
- == Terms and Definitions
432
-
433
- === Term1
434
-
435
- It is required that there is a definition.
436
-
437
- INPUT
438
- expect(File.read("test.err"))
439
- .to include "Definition may contain requirement"
440
- end
441
-
442
- it "warns that term example may contain recommendation" do
443
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
444
- #{VALIDATING_BLANK_HDR}
445
-
446
- == Terms and Definitions
447
-
448
- === Term
449
-
450
- [example]
451
- It is not recommended that widgets should be larger than 15 cm.
452
- INPUT
453
- expect(File.read("test.err"))
454
- .to include "Example may contain recommendation"
455
- end
456
-
457
- it "warns that note may contain recommendation" do
458
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
459
- #{VALIDATING_BLANK_HDR}
460
-
461
- NOTE: It is not recommended that widgets should be larger than 15 cm.
462
- INPUT
463
- expect(File.read("test.err")).to include "Note may contain recommendation"
464
- end
465
-
466
- it "warns that footnote may contain recommendation" do
467
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
468
- #{VALIDATING_BLANK_HDR}
469
-
470
- footnote:[It is not recommended that widgets should be larger than 15 cm.]
471
- INPUT
472
- expect(File.read("test.err"))
473
- .to include "Footnote may contain recommendation"
474
- end
475
-
476
- it "warns that term source is not in expected format" do
477
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
478
- #{VALIDATING_BLANK_HDR}
479
-
480
- [.source]
481
- I am a generic paragraph
482
- INPUT
483
- expect(File.read("test.err"))
484
- .to include "term reference not in expected format"
485
- end
486
-
487
- it "warns that figure does not have title" do
488
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
489
- #{VALIDATING_BLANK_HDR}
490
-
491
- image::spec/examples/rice_img/rice_image1.png[]
492
- INPUT
493
- expect(File.read("test.err")).to include "Figure should have title"
494
- end
495
-
496
- it "warns that callouts do not match annotations" do
497
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
498
- #{VALIDATING_BLANK_HDR}
499
- [source,ruby]
500
- --
501
- puts "Hello, world." <1>
502
- %w{a b c}.each do |x|
503
- puts x
504
- end
505
- --
506
- <1> This is one callout
507
- <2> This is another callout
508
- INPUT
509
- expect(File.read("test.err"))
510
- .to include "mismatch of callouts and annotations"
511
- end
512
-
513
- it "warns that term source is not a real reference" do
514
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
515
- #{VALIDATING_BLANK_HDR}
516
-
517
- [.source]
518
- <<iso123>>
519
- INPUT
520
- expect(File.read("test.err"))
521
- .to include "iso123 does not have a corresponding anchor ID " \
522
- "in the bibliography"
523
- end
524
-
525
- it "warns that undated reference has locality" do
526
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
527
- #{VALIDATING_BLANK_HDR}
528
-
529
- == Scope
530
- <<iso123,clause=1>>
531
-
532
- [bibliography]
533
- == Normative References
534
- * [[[iso123,ISO 123]]] _Standard_
535
- INPUT
536
- expect(File.read("test.err"))
537
- .to include "undated reference ISO 123 should not contain " \
538
- "specific elements"
539
- end
540
-
541
- it "do not warn that undated reference which is a bibliographic reference " \
542
- "has locality" do
543
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
544
- #{VALIDATING_BLANK_HDR}
545
-
546
- == Scope
547
- <<iso123,clause=1>>
548
-
549
- [bibliography]
550
- == Bibliography
551
- * [[[iso123,1]]] _Standard_
552
- INPUT
553
- expect(File.read("test.err"))
554
- .not_to include "undated reference [1] should not contain specific " \
555
- "elements"
556
- end
557
-
558
- it "do not warn that undated IEV reference has locality" do
559
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
560
- #{VALIDATING_BLANK_HDR}
561
-
562
- == Scope
563
- <<iev,clause=1>>
564
-
565
- [bibliography]
566
- == Normative References
567
- * [[[iev,IEV]]] _Standard_
568
- INPUT
569
- expect(File.read("test.err"))
570
- .not_to include "undated reference IEV should not contain specific " \
571
- "elements"
572
- end
573
-
574
- it "do not warn that in print has locality" do
575
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
576
- #{VALIDATING_BLANK_HDR}
577
-
578
- == Scope
579
- <<iev,clause=1>>
580
-
581
- [bibliography]
582
- == Normative References
583
- * [[[iev,ISO 123:--]]] _Standard_
584
- INPUT
585
- expect(File.read("test.err"))
586
- .not_to include "undated reference ISO 123 should not contain specific " \
587
- "elements"
588
- end
589
-
590
- it "warns of Non-reference in bibliography" do
591
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
592
- #{VALIDATING_BLANK_HDR}
593
-
594
- == Normative References
595
- * I am not a reference
596
- INPUT
597
- expect(File.read("test.err")).to include "no anchor on reference"
598
- end
599
-
600
- it "warns of Non-ISO reference in Normative References" do
601
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
602
- #{VALIDATING_BLANK_HDR}
603
-
604
- [bibliography]
605
- == Normative References
606
- * [[[XYZ,IESO 121]]] _Standard_
607
- INPUT
608
- expect(File.read("test.err"))
609
- .to include "non-ISO/IEC reference not expected as normative"
610
- end
611
-
612
- it "warns that Scope contains subclauses" do
613
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
614
- #{VALIDATING_BLANK_HDR}
615
-
616
- == Scope
617
-
618
- === Scope subclause
619
- INPUT
620
- expect(File.read("test.err"))
621
- .to include "Scope contains subclauses: should be succinct"
622
- end
623
-
624
- it "warns that Table should have title" do
625
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
626
- #{VALIDATING_BLANK_HDR}
627
-
628
- |===
629
- |a |b |c
630
- |===
631
- INPUT
632
- expect(File.read("test.err")).to include "Table should have title"
633
- end
634
-
635
- it "gives Style warning if number not broken up in threes" do
636
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
637
- #{VALIDATING_BLANK_HDR}
638
-
639
- == Clause
640
- 12121
641
- INPUT
642
- expect(File.read("test.err")).to include "number not broken up in threes"
643
- end
644
-
645
- it "gives No style warning if number not broken up in threes is " \
646
- "ISO reference" do
647
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
648
- #{VALIDATING_BLANK_HDR}
649
-
650
- == Clause
651
- ISO 12121
652
- INPUT
653
- expect(File.read("test.err"))
654
- .not_to include "number not broken up in threes"
655
- end
656
-
657
- it "Style warning if decimal point" do
658
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
659
- #{VALIDATING_BLANK_HDR}
660
-
661
- == Clause
662
- 8.1
663
- INPUT
664
- expect(File.read("test.err")).to include "possible decimal point"
665
- end
666
-
667
- it "Style warning if billion used" do
668
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
669
- #{VALIDATING_BLANK_HDR}
670
-
671
- == Clause
672
- "Billions" are a term of art.
673
- INPUT
674
- expect(File.read("test.err")).to include "ambiguous number"
675
- end
676
-
677
- it "Style warning if no space before percent sign" do
678
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
679
- #{VALIDATING_BLANK_HDR}
680
-
681
- == Clause
682
- 95%
683
- INPUT
684
- expect(File.read("test.err")).to include "no space before percent sign"
685
- end
686
-
687
- it "Style warning if unbracketed tolerance before percent sign" do
688
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
689
- #{VALIDATING_BLANK_HDR}
690
-
691
- == Clause
692
- 95 ± 5 %
693
- INPUT
694
- expect(File.read("test.err"))
695
- .to include "unbracketed tolerance before percent sign"
696
- end
697
-
698
- it "Style warning if dots in abbreviation" do
699
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
700
- #{VALIDATING_BLANK_HDR}
701
-
702
- == Clause
703
- r.p.m.
704
- INPUT
705
- expect(File.read("test.err")).to include "no dots in abbreviation"
706
- end
707
-
708
- it "No Style warning if dots in abbreviation are e.g." do
709
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
710
- #{VALIDATING_BLANK_HDR}
711
-
712
- == Clause
713
- e.g. 5
714
- INPUT
715
- expect(File.read("test.err")).not_to include "no dots in abbreviation"
716
- end
717
-
718
- it "Style warning if ppm used" do
719
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
720
- #{VALIDATING_BLANK_HDR}
721
-
722
- == Clause
723
- 5 ppm
724
- INPUT
725
- expect(File.read("test.err")).to include "language-specific abbreviation"
726
- end
727
-
728
- it "Style warning if space between number and degree" do
729
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
730
- #{VALIDATING_BLANK_HDR}
731
-
732
- == Clause
733
- 5 °
734
- INPUT
735
- expect(File.read("test.err"))
736
- .to include "space between number and degrees/minutes/seconds"
737
- end
738
-
739
- it "Style warning if hyphen instead of minus sign" do
740
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
741
- #{VALIDATING_BLANK_HDR}
742
-
743
- == Clause
744
- -2
745
- INPUT
746
- expect(File.read("test.err"))
747
- .to include "hyphen instead of minus sign U+2212"
748
- end
749
-
750
- it "Style warning if no space between number and SI unit" do
751
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
752
- #{VALIDATING_BLANK_HDR}
753
-
754
- == Clause
755
- A measurement of 5Bq was taken.
756
- INPUT
757
- expect(File.read("test.err"))
758
- .to include "no space between number and SI unit"
759
- end
760
-
761
- it "Style warning if mins used" do
762
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
763
- #{VALIDATING_BLANK_HDR}
764
-
765
- == Clause
766
- 5 mins
767
- INPUT
768
- expect(File.read("test.err")).to include "non-standard unit"
769
- end
770
-
771
- it "Style warning if and/or used" do
772
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
773
- #{VALIDATING_BLANK_HDR}
774
-
775
- == Clause
776
- 7 and/or 8
777
- INPUT
778
- expect(File.read("test.err")).to include "Use 'either x or y, or both'"
779
- end
780
-
781
- it "Style warning if & used" do
782
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
783
- #{VALIDATING_BLANK_HDR}
784
-
785
- == Clause
786
- 7 & 8
787
- INPUT
788
- expect(File.read("test.err")).to include "Avoid ampersand in ordinary text"
789
- end
790
-
791
- it "Style warning if full stop used in title or caption" do
792
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
793
- #{VALIDATING_BLANK_HDR}
794
-
795
- == Clause.
796
-
797
- .Table.
798
- |===
799
- | A |B
800
- |===
801
-
802
- === Clause 2.
803
-
804
- .Figure.
805
- ....
806
- Z
807
- ....
808
-
809
- .Other Figure
810
- ....
811
- A
812
- ....
813
- INPUT
814
- expect(File.read("test.err"))
815
- .to include "No full stop at end of title or caption: Clause."
816
- expect(File.read("test.err"))
817
- .to include "No full stop at end of title or caption: Clause 2."
818
- expect(File.read("test.err"))
819
- .to include "No full stop at end of title or caption: Table."
820
- expect(File.read("test.err"))
821
- .to include "No full stop at end of title or caption: Figure."
822
- expect(File.read("test.err"))
823
- .not_to include "No full stop at end of title or caption: Other Figure."
824
- end
825
-
826
- # can't test: our asciidoc template won't allow this to be generated
827
- # it "Style warning if foreword contains subclauses" do
828
- # expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }
829
- # .to output(%r{non-standard unit}).to_stderr
830
- # #{VALIDATING_BLANK_HDR}
831
- #
832
- # INPUT
833
- # end
834
-
835
- # can't test: we strip out any such content from Normative references preemptively
836
- # it "Style warning if Normative References contains subclauses" do
837
- # expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }
838
- # .to output(%r{normative references contains subclauses}).to_stderr
839
- # #{VALIDATING_BLANK_HDR}
840
- #
841
- # [bibliography]
842
- #== Normative References
843
- #
844
- #=== Subsection
845
- # INPUT
846
- # end
847
-
848
- it "Style warning if two Symbols and Abbreviated Terms sections" do
849
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
850
- #{VALIDATING_BLANK_HDR}
851
-
852
- == Terms and Abbreviations
853
-
854
- === Symbols and Abbreviated Terms
855
-
856
- == Symbols and Abbreviated Terms
857
- INPUT
858
- expect(File.read("test.err"))
859
- .to include "Only one Symbols and Abbreviated Terms section " \
860
- "in the standard"
861
- end
862
-
863
- it "Style warning if Symbols and Abbreviated Terms contains " \
864
- "extraneous matter" do
865
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
866
- #{VALIDATING_BLANK_HDR}
867
-
868
- == Symbols and Abbreviated Terms
869
-
870
- Paragraph
871
- INPUT
872
- expect(File.read("test.err"))
873
- .to include "Symbols and Abbreviated Terms can only contain " \
874
- "a definition list"
875
-
876
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
877
- #{VALIDATING_BLANK_HDR}
878
-
879
- == Symbols and Abbreviated Terms
880
-
881
- A:: B
882
- INPUT
883
- expect(File.read("test.err"))
884
- .not_to include "Symbols and Abbreviated Terms can only contain " \
885
- "a definition list"
886
- end
887
-
888
- it "Warning if missing foreword" do
889
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
890
- #{VALIDATING_BLANK_HDR}
891
-
892
- == Symbols and Abbreviated Terms
893
-
894
- Paragraph
895
- INPUT
896
- expect(File.read("test.err"))
897
- .to include "Initial section must be (content) Foreword"
898
-
899
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
900
- = Document title
901
- Author
902
- :docfile: test.adoc
903
- :nodoc:
904
- :no-isobib:
905
- :doctype: amendment
906
-
907
- == Symbols and Abbreviated Terms
908
-
909
- Paragraph
910
- INPUT
911
- expect(File.read("test.err"))
912
- .not_to include "Initial section must be (content) Foreword"
913
- end
914
-
915
- it "Warning if do not start with scope or introduction" do
916
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
917
- #{VALIDATING_BLANK_HDR}
918
- Foreword
919
-
920
- == Symbols and Abbreviated Terms
921
-
922
- Paragraph
923
- INPUT
924
- expect(File.read("test.err"))
925
- .to include "Prefatory material must be followed by (clause) Scope"
926
-
927
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
928
- = Document title
929
- Author
930
- :docfile: test.adoc
931
- :nodoc:
932
- :no-isobib:
933
- :doctype: amendment
934
-
935
- Foreword
936
-
937
- == Symbols and Abbreviated Terms
938
-
939
- Paragraph
940
- INPUT
941
- expect(File.read("test.err"))
942
- .not_to include "Prefatory material must be followed by (clause) Scope"
943
- end
944
-
945
- it "Warning if introduction not followed by scope" do
946
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
947
- #{VALIDATING_BLANK_HDR}
948
-
949
- .Foreword
950
- Foreword
951
-
952
- == Introduction
953
-
954
- == Symbols and Abbreviated Terms
955
-
956
- Paragraph
957
- INPUT
958
- expect(File.read("test.err"))
959
- .to include "Prefatory material must be followed by (clause) Scope"
960
-
961
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
962
- = Document title
963
- Author
964
- :docfile: test.adoc
965
- :nodoc:
966
- :no-isobib:
967
- :doctype: amendment
968
-
969
- .Foreword
970
- Foreword
971
-
972
- == Introduction
973
-
974
- == Symbols and Abbreviated Terms
975
-
976
- Paragraph
977
- INPUT
978
- expect(File.read("test.err"))
979
- .not_to include "Prefatory material must be followed by (clause) Scope"
980
- end
981
-
982
- it "Warning if normative references not followed by terms and definitions" do
983
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
984
- #{VALIDATING_BLANK_HDR}
985
-
986
- .Foreword
987
- Foreword
988
-
989
- == Scope
990
-
991
- [bibliography]
992
- == Normative References
993
-
994
- == Symbols and Abbreviated Terms
995
-
996
- Paragraph
997
- INPUT
998
- expect(File.read("test.err"))
999
- .to include "Normative References must be followed by " \
1000
- "Terms and Definitions"
1001
-
1002
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1003
- = Document title
1004
- Author
1005
- :docfile: test.adoc
1006
- :nodoc:
1007
- :no-isobib:
1008
- :doctype: amendment
1009
-
1010
- .Foreword
1011
- Foreword
1012
-
1013
- == Scope
1014
-
1015
- [bibliography]
1016
- == Normative References
1017
-
1018
- == Symbols and Abbreviated Terms
1019
-
1020
- Paragraph
1021
- INPUT
1022
- expect(File.read("test.err"))
1023
- .not_to include "Normative References must be followed by " \
1024
- "Terms and Definitions"
1025
- end
1026
-
1027
- it "Warning if there are no clauses in the document" do
1028
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1029
- #{VALIDATING_BLANK_HDR}
1030
-
1031
- .Foreword
1032
- Foreword
1033
-
1034
- == Scope
1035
-
1036
- [bibliography]
1037
- == Normative References
1038
-
1039
- == Terms and Definitions
1040
-
1041
- == Symbols and Abbreviated Terms
1042
-
1043
- INPUT
1044
- expect(File.read("test.err"))
1045
- .to include "Document must contain at least one clause"
1046
-
1047
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1048
- = Document title
1049
- Author
1050
- :docfile: test.adoc
1051
- :nodoc:
1052
- :no-isobib:
1053
- :doctype: amendment
1054
-
1055
- .Foreword
1056
- Foreword
1057
-
1058
- == Scope
1059
-
1060
- [bibliography]
1061
- == Normative References
1062
-
1063
- == Terms and Definitions
1064
-
1065
- == Symbols and Abbreviated Terms
1066
-
1067
- INPUT
1068
- expect(File.read("test.err"))
1069
- .not_to include "Document must contain at least one clause"
1070
- end
1071
-
1072
- it "Warning if scope occurs after Terms and Definitions" do
1073
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1074
- #{VALIDATING_BLANK_HDR}
1075
-
1076
- .Foreword
1077
- Foreword
1078
-
1079
- == Scope
1080
-
1081
- [bibliography]
1082
- == Normative References
1083
-
1084
- == Terms and Definitions
1085
-
1086
- == Clause
1087
-
1088
- == Scope
1089
-
1090
- INPUT
1091
- expect(File.read("test.err"))
1092
- .to include "Scope must occur before Terms and Definitions"
1093
-
1094
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1095
- = Document title
1096
- Author
1097
- :docfile: test.adoc
1098
- :nodoc:
1099
- :no-isobib:
1100
- :doctype: amendment
1101
-
1102
- .Foreword
1103
- Foreword
1104
-
1105
- == Scope
1106
-
1107
- [bibliography]
1108
- == Normative References
1109
-
1110
- == Terms and Definitions
1111
-
1112
- == Clause
1113
-
1114
- == Scope
1115
-
1116
- INPUT
1117
- expect(File.read("test.err"))
1118
- .not_to include "Scope must occur before Terms and Definitions"
1119
- end
1120
-
1121
- it "Warning if Symbols and Abbreviated Terms does not occur immediately " \
1122
- "after Terms and Definitions" do
1123
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1124
- #{VALIDATING_BLANK_HDR}
1125
-
1126
- .Foreword
1127
- Foreword
1128
-
1129
- == Scope
1130
-
1131
- [bibliography]
1132
- == Normative References
1133
-
1134
- == Terms and Definitions
1135
-
1136
- == Clause
1137
-
1138
- == Symbols and Abbreviated Terms
1139
-
1140
- INPUT
1141
- expect(File.read("test.err"))
1142
- .to include "Only annexes and references can follow clauses"
1143
-
1144
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1145
- = Document title
1146
- Author
1147
- :docfile: test.adoc
1148
- :nodoc:
1149
- :no-isobib:
1150
- :doctype: amendment
1151
-
1152
-
1153
- .Foreword
1154
- Foreword
1155
-
1156
- == Scope
1157
-
1158
- [bibliography]
1159
- == Normative References
1160
-
1161
- == Terms and Definitions
1162
-
1163
- == Clause
1164
-
1165
- == Symbols and Abbreviated Terms
1166
-
1167
- INPUT
1168
- expect(File.read("test.err"))
1169
- .not_to include "Only annexes and references can follow clauses"
1170
- end
1171
-
1172
- it "Warning if no normative references" do
1173
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1174
- #{VALIDATING_BLANK_HDR}
1175
-
1176
- .Foreword
1177
- Foreword
1178
-
1179
- == Scope
1180
-
1181
- == Terms and Definitions
1182
-
1183
- == Clause
1184
-
1185
- [appendix]
1186
- == Appendix A
1187
-
1188
- [appendix]
1189
- == Appendix B
1190
-
1191
- [appendix]
1192
- == Appendix C
1193
-
1194
- INPUT
1195
- expect(File.read("test.err"))
1196
- .to include "Document must include (references) Normative References"
1197
-
1198
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1199
- = Document title
1200
- Author
1201
- :docfile: test.adoc
1202
- :nodoc:
1203
- :no-isobib:
1204
- :doctype: amendment
1205
-
1206
- .Foreword
1207
- Foreword
1208
-
1209
- == Scope
1210
-
1211
- == Terms and Definitions
1212
-
1213
- == Clause
1214
-
1215
- [appendix]
1216
- == Appendix A
1217
-
1218
- [appendix]
1219
- == Appendix B
1220
-
1221
- [appendix]
1222
- == Appendix C
1223
-
1224
- INPUT
1225
- expect(File.read("test.err"))
1226
- .not_to include "Document must include (references) Normative References"
1227
- end
1228
-
1229
- it "Warning if there are two Terms sections" do
1230
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1231
- #{VALIDATING_BLANK_HDR}
1232
-
1233
- == Scope
1234
-
1235
- == Terms and definitions
1236
-
1237
- == A Clause
1238
-
1239
- [heading=terms and definitions]
1240
- == Terms related to clinical psychology
1241
-
1242
- INPUT
1243
- expect(File.read("test.err"))
1244
- .to include "Only annexes and references can follow clauses"
1245
- end
1246
-
1247
- it "No warning if there are two Terms sections in a Vocabulary document" do
1248
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1249
- = Document title
1250
- Author
1251
- :docfile: test.adoc
1252
- :nodoc:
1253
- :no-isobib:
1254
- :docsubtype: vocabulary
1255
-
1256
- == Scope
1257
-
1258
- == Terms and definitions
1259
-
1260
- == A Clause
1261
-
1262
- [heading=terms and definitions]
1263
- == Terms related to clinical psychology
1264
-
1265
- [heading=symbols and abbreviated terms]
1266
- == Symbols related to clinical psychology
1267
-
1268
- INPUT
1269
- expect(File.read("test.err"))
1270
- .not_to include "Only annexes and references can follow clauses"
1271
- expect(File.read("test.err"))
1272
- .not_to include "Scope must occur before Terms and Definitions"
1273
- expect(File.read("test.err"))
1274
- .to include "Only annexes and references can follow terms and clauses"
1275
- end
1276
-
1277
- it "No warning if there are two Symbols sections in a Vocabulary document" do
1278
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1279
- = Document title
1280
- Author
1281
- :docfile: test.adoc
1282
- :nodoc:
1283
- :no-isobib:
1284
- :docsubtype: vocabulary
1285
-
1286
- == Scope
1287
-
1288
- == Terms and definitions
1289
-
1290
- == A Clause
1291
-
1292
- [heading=symbols and abbreviated terms]
1293
- == Terms related to clinical psychology
1294
-
1295
- [heading=symbols and abbreviated terms]
1296
- == Symbols related to clinical psychology
1297
-
1298
- INPUT
1299
- expect(File.read("test.err"))
1300
- .not_to include "Only one Symbols and Abbreviated Terms section " \
1301
- "in the standard"
1302
- end
1303
-
1304
- it "Warn if single terms section in vocabulary document not named properly" do
1305
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1306
- = Document title
1307
- Author
1308
- :docfile: test.adoc
1309
- :nodoc:
1310
- :no-isobib:
1311
- :docsubtype: vocabulary
1312
-
1313
- == Scope
1314
- [heading=terms and definitions]
1315
- == Terms and redefinitions
1316
-
1317
- INPUT
1318
- expect(File.read("test.err"))
1319
- .to include "Single terms clause in vocabulary document should have " \
1320
- "normal Terms and definitions heading"
1321
- expect(File.read("test.err"))
1322
- .not_to include "Multiple terms clauses in vocabulary document should " \
1323
- "have 'Terms related to' heading"
1324
- end
1325
-
1326
- it "Warn if vocabulary document contains Symbols section outside annex" do
1327
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1328
- = Document title
1329
- Author
1330
- :docfile: test.adoc
1331
- :nodoc:
1332
- :no-isobib:
1333
- :docsubtype: vocabulary
1334
-
1335
- == Scope
1336
-
1337
- == Terms and definitions
1338
-
1339
- == A Clause
1340
-
1341
- [heading=symbols and abbreviated terms]
1342
- == Terms related to clinical psychology
1343
-
1344
- INPUT
1345
- expect(File.read("test.err"))
1346
- .to include "In vocabulary documents, Symbols and Abbreviated Terms are " \
1347
- "only permitted in annexes"
1348
- end
1349
-
1350
- it "Warning if multiple terms section in vocabulary document not named " \
1351
- "properly" do
1352
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1353
- = Document title
1354
- Author
1355
- :docfile: test.adoc
1356
- :nodoc:
1357
- :no-isobib:
1358
- :docsubtype: vocabulary
1359
-
1360
- == Terms and definitions
1361
-
1362
- [heading=terms and definitions]
1363
- == Terms related to fish
1364
-
1365
- INPUT
1366
- expect(File.read("test.err"))
1367
- .not_to include "Single terms clause in vocabulary document should have " \
1368
- "normal Terms and definitions heading"
1369
- expect(File.read("test.err"))
1370
- .to include "Multiple terms clauses in vocabulary document should " \
1371
- "have 'Terms related to' heading"
1372
- end
1373
-
1374
- it "Warning if final section is not named Bibliography" do
1375
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1376
- #{VALIDATING_BLANK_HDR}
1377
-
1378
- .Foreword
1379
- Foreword
1380
-
1381
- == Scope
1382
-
1383
- [bibliography]
1384
- == Normative References
1385
-
1386
- == Terms and Definitions
1387
-
1388
- == Clause
1389
-
1390
- [appendix]
1391
- == Appendix A
1392
-
1393
- [appendix]
1394
- == Appendix B
1395
-
1396
- [bibliography]
1397
- == Bibliography
1398
-
1399
- [bibliography]
1400
- == Appendix C
1401
-
1402
- INPUT
1403
- expect(File.read("test.err"))
1404
- .to include "There are sections after the final Bibliography"
1405
-
1406
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1407
- = Document title
1408
- Author
1409
- :docfile: test.adoc
1410
- :nodoc:
1411
- :no-isobib:
1412
- :doctype: amendment
1413
-
1414
- .Foreword
1415
- Foreword
1416
-
1417
- == Scope
1418
-
1419
- [bibliography]
1420
- == Normative References
1421
-
1422
- == Terms and Definitions
1423
-
1424
- == Clause
1425
-
1426
- [appendix]
1427
- == Appendix A
1428
-
1429
- [appendix]
1430
- == Appendix B
1431
-
1432
- [bibliography]
1433
- == Bibliography
1434
-
1435
- [bibliography]
1436
- == Appendix C
1437
-
1438
- INPUT
1439
- expect(File.read("test.err"))
1440
- .not_to include "There are sections after the final Bibliography"
1441
- end
1442
-
1443
- it "Warning if final section is not styled Bibliography" do
1444
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1445
- #{VALIDATING_BLANK_HDR}
1446
-
1447
- .Foreword
1448
- Foreword
1449
-
1450
- == Scope
1451
-
1452
- [bibliography]
1453
- == Normative References
1454
-
1455
- == Terms and Definitions
1456
-
1457
- == Clause
1458
-
1459
- [appendix]
1460
- == Appendix A
1461
-
1462
- [appendix]
1463
- == Appendix B
1464
-
1465
- == Bibliography
1466
-
1467
- INPUT
1468
- expect(File.read("test.err"))
1469
- .to include "Section not marked up as [bibliography]"
1470
- end
1471
-
1472
- it "Warning if final section is not styled Bibliography false" do
1473
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1474
- = Document title
1475
- Author
1476
- :docfile: test.adoc
1477
- :nodoc:
1478
- :no-isobib:
1479
- :doctype: amendment
1480
-
1481
- .Foreword
1482
- Foreword
1483
-
1484
- == Scope
1485
-
1486
- [bibliography]
1487
- == Normative References
1488
-
1489
- == Terms and Definitions
1490
-
1491
- == Clause
1492
-
1493
- [appendix]
1494
- == Appendix A
1495
-
1496
- [appendix]
1497
- == Appendix B
1498
-
1499
- == Bibliography
1500
-
1501
- INPUT
1502
- expect(File.read("test.err"))
1503
- .not_to include "Section not marked up as [bibliography]"
1504
- end
1505
-
1506
- it "Warning if English title intro and no French title intro" do
1507
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1508
- = Document title
1509
- Author
1510
- :docfile: test.adoc
1511
- :nodoc:
1512
- :title-intro-en: Title
1513
- :no-isobib:
1514
-
1515
- INPUT
1516
- expect(File.read("test.err")).to include "No French Title Intro"
1517
- end
1518
-
1519
- it "Warning if French title intro and no English title intro" do
1520
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1521
- = Document title
1522
- Author
1523
- :docfile: test.adoc
1524
- :nodoc:
1525
- :title-intro-fr: Title
1526
- :no-isobib:
1527
-
1528
- INPUT
1529
- expect(File.read("test.err")).to include "No English Title Intro"
1530
- end
1531
-
1532
- it "Warning if English title and no French title" do
1533
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1534
- = Document title
1535
- Author
1536
- :docfile: test.adoc
1537
- :nodoc:
1538
- :title-main-en: Title
1539
- :no-isobib:
1540
-
1541
- INPUT
1542
- expect(File.read("test.err")).to include "No French Title"
1543
- expect(File.read("test.err")).not_to include "No French Intro"
1544
- end
1545
-
1546
- it "Warning if French title and no English title" do
1547
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1548
- = Document title
1549
- Author
1550
- :docfile: test.adoc
1551
- :nodoc:
1552
- :title-main-fr: Title
1553
- :no-isobib:
1554
-
1555
- INPUT
1556
- expect(File.read("test.err")).to include "No English Title"
1557
- end
1558
-
1559
- it "Warning if English title part and no French title part" do
1560
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1561
- = Document title
1562
- Author
1563
- :docfile: test.adoc
1564
- :nodoc:
1565
- :title-part-en: Title
1566
- :no-isobib:
1567
-
1568
- INPUT
1569
- expect(File.read("test.err")).to include "No French Title Part"
1570
- end
1571
-
1572
- it "Warning if French title part and no English title part" do
1573
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1574
- = Document title
1575
- Author
1576
- :docfile: test.adoc
1577
- :nodoc:
1578
- :title-part-fr: Title
1579
- :no-isobib:
1580
-
1581
- INPUT
1582
- expect(File.read("test.err")).to include "No English Title Part"
1583
- end
1584
-
1585
- it "No warning if French main title and English main title" do
1586
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1587
- = Document title
1588
- Author
1589
- :docfile: test.adoc
1590
- :nodoc:
1591
- :title-part-fr: Title
1592
- :title-part-en: Title
1593
- :no-isobib:
1594
-
1595
- INPUT
1596
- expect(File.read("test.err")).not_to include "No French Title Intro"
1597
- expect(File.read("test.err")).not_to include "No French Title Part"
1598
- end
1599
-
1600
- it "Warning if non-IEC document with subpart" do
1601
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1602
- = Document title
1603
- Author
1604
- :docfile: test.adoc
1605
- :nodoc:
1606
- :docnumber: 10
1607
- :partnumber: 1-1
1608
- :publisher: ISO
1609
- :no-isobib:
1610
-
1611
- INPUT
1612
- expect(File.read("test.err"))
1613
- .to include "Subpart defined on non-IEC document"
1614
- end
1615
-
1616
- it "No warning if joint IEC/non-IEC document with subpart" do
1617
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1618
- = Document title
1619
- Author
1620
- :docfile: test.adoc
1621
- :nodoc:
1622
- :docnumber: 10
1623
- :partnumber: 1-1
1624
- :publisher: ISO;IEC
1625
- :no-isobib:
1626
-
1627
- INPUT
1628
- expect(File.read("test.err"))
1629
- .not_to include "Subpart defined on non-IEC document"
1630
- end
1631
-
1632
- it "Warning if main title contains document type" do
1633
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1634
- = Document title
1635
- Author
1636
- :docfile: test.adoc
1637
- :nodoc:
1638
- :title-main-en: A Technical Specification on Widgets
1639
- :no-isobib:
1640
-
1641
- INPUT
1642
- expect(File.read("test.err")).to include "Main Title may name document type"
1643
- end
1644
-
1645
- it "Warning if intro title contains document type" do
1646
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1647
- = Document title
1648
- Author
1649
- :docfile: test.adoc
1650
- :nodoc:
1651
- :title-intro-en: A Technical Specification on Widgets
1652
- :no-isobib:
1653
-
1654
- INPUT
1655
- expect(File.read("test.err"))
1656
- .to include "Title Intro may name document type"
1657
- end
1658
-
1659
- it "Each first-level subclause must have a title" do
1660
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1661
- #{VALIDATING_BLANK_HDR}
1662
- == Clause
1663
-
1664
- === {blank}
1665
- INPUT
1666
- expect(File.read("test.err"))
1667
- .to include "each first-level subclause must have a title"
1668
- end
1669
-
1670
- it "All subclauses must have a title, or none" do
1671
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1672
- #{VALIDATING_BLANK_HDR}
1673
- == Clause
1674
-
1675
- === Subclause
1676
-
1677
- ==== {blank}
1678
-
1679
- ==== Subsubclause
1680
- INPUT
1681
- expect(File.read("test.err"))
1682
- .to include "all subclauses must have a title, or none"
1683
- end
1684
-
1685
- it "Warning if subclause is only child of its parent, or none" do
1686
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1687
- #{VALIDATING_BLANK_HDR}
1688
- == Clause
1689
-
1690
- === Subclause
1691
-
1692
- INPUT
1693
- expect(File.read("test.err")).to include "subclause is only child"
1694
- end
1695
-
1696
- it "Warning if invalid technical committee type" do
1697
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1698
- = Document title
1699
- Author
1700
- :docfile: test.adoc
1701
- :nodoc:
1702
- :technical-committee-type: X
1703
- :technical-committee-number: X
1704
- :no-isobib:
1705
-
1706
- INPUT
1707
- expect(File.read("test.err")).to include "invalid technical committee type"
1708
- end
1709
-
1710
- it "Warning if invalid subcommittee type" do
1711
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1712
- = Document title
1713
- Author
1714
- :docfile: test.adoc
1715
- :nodoc:
1716
- :subcommittee-type: X
1717
- :subcommittee-number: X
1718
- :no-isobib:
1719
-
1720
- INPUT
1721
- expect(File.read("test.err")).to include "invalid subcommittee type"
1722
- end
1723
-
1724
- it "Warning if 'see' crossreference points to normative section" do
1725
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1726
- #{VALIDATING_BLANK_HDR}
1727
- [[terms]]
1728
- == Terms and Definitions
1729
-
1730
- == Clause
1731
- See <<terms>>
1732
- INPUT
1733
- expect(File.read("test.err"))
1734
- .to include "'see terms' is pointing to a normative section"
1735
- end
1736
-
1737
- it "Warning if 'see' reference points to normative reference" do
1738
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1739
- #{VALIDATING_BLANK_HDR}
1740
- [bibliography]
1741
- == Normative References
1742
- * [[[terms,ISO 1]]] _References_
1743
-
1744
- == Clause
1745
- See <<terms>>
1746
- INPUT
1747
- expect(File.read("test.err"))
1748
- .to include "is pointing to a normative reference"
1749
- end
1750
-
1751
- it "Warning if term definition starts with article" do
1752
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1753
- #{VALIDATING_BLANK_HDR}
1754
- == Terms and Definitions
1755
-
1756
- === Term
1757
-
1758
- The definition of a term is a part of the specialized vocabulary of a particular field
1759
- INPUT
1760
- expect(File.read("test.err"))
1761
- .to include "term definition starts with article"
1762
- end
1763
-
1764
- it "Warning if term definition ends with period" do
1765
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1766
- #{VALIDATING_BLANK_HDR}
1767
- == Terms and Definitions
1768
-
1769
- === Term
1770
-
1771
- Part of the specialized vocabulary of a particular field.
1772
- INPUT
1773
- expect(File.read("test.err")).to include "term definition ends with period"
1774
- end
1775
-
1776
- it "validates document against ISO XML schema" do
1777
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1778
- #{VALIDATING_BLANK_HDR}
1779
-
1780
- [align=mid-air]
1781
- Para
1782
- INPUT
1783
- expect(File.read("test.err"))
1784
- .to include 'value of attribute "align" is invalid; must be equal to'
1785
- end
1786
-
1787
- it "Warn if more than 7 levels of subclause" do
1788
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1789
- #{VALIDATING_BLANK_HDR}
1790
-
1791
- == Clause
1792
-
1793
- === Clause
1794
-
1795
- ==== Clause
1796
-
1797
- ===== Clause
1798
-
1799
- ====== Clause
1800
-
1801
- [level=6]
1802
- ====== Clause
1803
-
1804
- [level=7]
1805
- ====== Clause
1806
-
1807
- [level=8]
1808
- ====== Clause
1809
-
1810
- INPUT
1811
- expect(File.read("test.err"))
1812
- .to include "Exceeds the maximum clause depth of 7"
1813
- end
1814
-
1815
- it "Do not warn if not more than 7 levels of subclause" do
1816
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1817
- #{VALIDATING_BLANK_HDR}
1818
-
1819
- == Clause
1820
-
1821
- === Clause
1822
-
1823
- ==== Clause
1824
-
1825
- ===== Clause
1826
-
1827
- ====== Clause
1828
-
1829
- [level=6]
1830
- ====== Clause
1831
-
1832
- [level=7]
1833
- ====== Clause
1834
-
1835
- INPUT
1836
- expect(File.read("test.err"))
1837
- .not_to include "exceeds the maximum clause depth of 7"
1838
- end
1839
-
1840
- it "Warn if an undated reference has no associated footnote" do
1841
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1842
- #{VALIDATING_BLANK_HDR}
1843
-
1844
- [bibliography]
1845
- == Bibliography
1846
- * [[[ISO8,ISO 8:--]]], _Title_
1847
- INPUT
1848
- expect(File.read("test.err"))
1849
- .to include "Reference ISO8 does not have an associated footnote " \
1850
- "indicating unpublished status"
1851
- end
1852
-
1853
- it "Warn if no colon or full stop before list" do
1854
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1855
- #{VALIDATING_BLANK_HDR}
1856
-
1857
- == Clause
1858
-
1859
- X
1860
-
1861
- * A very long
1862
- * B list
1863
- * C
1864
- INPUT
1865
- expect(File.read("test.err"))
1866
- .to include "All lists must be preceded by colon or full stop"
1867
- end
1868
-
1869
- it "Do not warn if colon or full stop before list" do
1870
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1871
- #{VALIDATING_BLANK_HDR}
1872
-
1873
- == Clause
1874
-
1875
- X.
1876
-
1877
- * A very long
1878
- * B list
1879
- * C
1880
-
1881
- X:
1882
-
1883
- . A very long
1884
- . B list
1885
- . C
1886
- INPUT
1887
- expect(File.read("test.err"))
1888
- .not_to include "All lists must be preceded by colon or full stop"
1889
- end
1890
-
1891
- it "Warn of list punctuation after colon" do
1892
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1893
- #{VALIDATING_BLANK_HDR}
1894
-
1895
- == Clause
1896
-
1897
- X:
1898
-
1899
- * this is;
1900
- * another broken up;
1901
- * Sentence.
1902
-
1903
- X:
1904
-
1905
- . this is
1906
- . another broken up;
1907
- . sentence
1908
-
1909
- X:
1910
-
1911
- . sentence.
1912
-
1913
- X:
1914
-
1915
- . This is.
1916
- . Another broken up.
1917
- . Sentence.
1918
- INPUT
1919
- expect(File.read("test.err"))
1920
- .to include "List entry of broken up sentence must start with " \
1921
- "lowercase letter: Sentence."
1922
- expect(File.read("test.err"))
1923
- .not_to include "List entry of broken up sentence must start with " \
1924
- "lowercase letter: another broken up;."
1925
- expect(File.read("test.err"))
1926
- .to include "List entry of broken up sentence must end with semicolon: " \
1927
- "this is"
1928
- expect(File.read("test.err"))
1929
- .to include "Final list entry of broken up sentence must end with " \
1930
- "full stop: sentence"
1931
- expect(File.read("test.err"))
1932
- .not_to include "Final list entry of broken up sentence must end with " \
1933
- "full stop: sentence."
1934
- expect(File.read("test.err"))
1935
- .not_to include "List entry of broken up sentence must start with " \
1936
- "lowercase letter: Another broken up."
1937
- expect(File.read("test.err"))
1938
- .not_to include "List entry of broken up sentence must end with " \
1939
- "semicolon: This is."
1940
- end
1941
-
1942
- it "Warn of list punctuation after full stop" do
1943
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1944
- #{VALIDATING_BLANK_HDR}
1945
-
1946
- == Clause
1947
-
1948
- X.
1949
-
1950
- * This is;
1951
- * Another broken up.
1952
- * sentence.
1953
-
1954
- INPUT
1955
- expect(File.read("test.err"))
1956
- .to include "List entry of separate sentences must end with full stop: " \
1957
- "This is;"
1958
- expect(File.read("test.err"))
1959
- .not_to include "List entry of separate sentences must end with " \
1960
- "full stop: Another broken up."
1961
- expect(File.read("test.err"))
1962
- .to include "List entry of separate sentences must start with " \
1963
- "uppercase letter: sentence."
1964
- end
1965
-
1966
- it "Skips punctuation check for short entries in lists" do
1967
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1968
- #{VALIDATING_BLANK_HDR}
1969
-
1970
- == Clause
1971
-
1972
- X.
1973
-
1974
- * This is
1975
- * Another
1976
- * sentence
1977
-
1978
- INPUT
1979
- expect(File.read("test.err"))
1980
- .not_to include "List entry after full stop must end with full stop: " \
1981
- "This is"
1982
- end
1983
-
1984
- it "Skips punctuation check for lists within tables" do
1985
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1986
- #{VALIDATING_BLANK_HDR}
1987
-
1988
- == Clause
1989
-
1990
- |===
1991
- | A
1992
- a|
1993
- * This is
1994
- * Another
1995
- * sentence
1996
- |===
1997
-
1998
- INPUT
1999
- expect(File.read("test.err"))
2000
- .not_to include "List entry after full stop must end with full stop: " \
2001
- "This is"
2002
- end
2003
-
2004
- it "Warn if more than one ordered lists in a clause" do
2005
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2006
- #{VALIDATING_BLANK_HDR}
2007
-
2008
- == Clause
2009
-
2010
- . A
2011
- .. B
2012
- ... C
2013
-
2014
- a
2015
-
2016
- . A
2017
- .. B
2018
-
2019
- a
2020
-
2021
- . B
2022
-
2023
- INPUT
2024
- expect(File.read("test.err"))
2025
- .to include "More than 1 ordered list in a numbered clause"
2026
-
2027
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2028
- #{VALIDATING_BLANK_HDR}
2029
-
2030
- == Clause
2031
-
2032
- . A
2033
- .. B
2034
- ... C
2035
-
2036
- === Clause
2037
- a
2038
-
2039
- . A
2040
- .. B
2041
-
2042
- a
2043
-
2044
- INPUT
2045
- expect(File.read("test.err"))
2046
- .not_to include "More than 1 ordered list in a numbered clause"
2047
- end
2048
-
2049
- it "Warn if list more than four levels deep" do
2050
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2051
- #{VALIDATING_BLANK_HDR}
2052
-
2053
- == Clause
2054
-
2055
- . A
2056
- .. B
2057
- ... C
2058
- .... D
2059
-
2060
- INPUT
2061
- expect(File.read("test.err"))
2062
- .not_to include "List more than four levels deep"
2063
-
2064
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2065
- #{VALIDATING_BLANK_HDR}
2066
-
2067
- == Clause
2068
-
2069
- . A
2070
- .. B
2071
- ... C
2072
- .... D
2073
- ..... E
2074
-
2075
- INPUT
2076
- expect(File.read("test.err"))
2077
- .to include "List more than four levels deep"
2078
-
2079
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2080
- #{VALIDATING_BLANK_HDR}
2081
-
2082
- == Clause
2083
-
2084
- * A
2085
- ** B
2086
- *** C
2087
- **** D
2088
- ***** E
2089
-
2090
- INPUT
2091
- expect(File.read("test.err"))
2092
- .to include "List more than four levels deep"
2093
-
2094
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2095
- #{VALIDATING_BLANK_HDR}
2096
-
2097
- == Clause
2098
-
2099
- * A
2100
- .. B
2101
- *** C
2102
- .... D
2103
- ***** E
2104
-
2105
- INPUT
2106
- expect(File.read("test.err"))
2107
- .to include "List more than four levels deep"
2108
- end
2109
-
2110
- it "warn if term clause crossreferences non-term reference" do
2111
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2112
- #{VALIDATING_BLANK_HDR}
2113
-
2114
- == Terms and definitions
2115
-
2116
- [[b]]
2117
- === Term 1
2118
- <<b>>
2119
- <<c>>
2120
-
2121
- [[c]]
2122
- == Clause
2123
-
2124
- INPUT
2125
- expect(File.read("test.err"))
2126
- .to include "non-terms clauses cannot cross-reference terms clause (c)"
2127
- expect(File.read("test.err"))
2128
- .not_to include "non-terms clauses cannot cross-reference terms " \
2129
- "clause (b)"
2130
- end
2131
-
2132
- it "warn if non-term clause crossreferences term reference" do
2133
- Asciidoctor.convert(<<~"INPUT", *OPTIONS)
2134
- #{VALIDATING_BLANK_HDR}
2135
-
2136
- == Terms and definitions
2137
-
2138
- [[b]]
2139
- === Term 1
2140
- _<<b>>_
2141
- _<<c>>_
2142
-
2143
- == Clause
2144
- _<<b>>_
2145
- _<<c>>_
2146
-
2147
- INPUT
2148
- expect(File.read("test.err"))
2149
- .to include "only terms clauses can cross-reference terms clause (b)"
2150
- expect(File.read("test.err"))
2151
- .not_to include "only terms clauses can cross-reference terms clause (c)"
2152
- end
2153
- end