metanorma-iso 1.7.1 → 1.7.2

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