metanorma-standoc 1.9.2 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -13
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +4 -6
  5. data/lib/asciidoctor/standoc/base.rb +3 -1
  6. data/lib/asciidoctor/standoc/biblio.rng +1 -0
  7. data/lib/asciidoctor/standoc/blocks.rb +1 -1
  8. data/lib/asciidoctor/standoc/cleanup.rb +34 -15
  9. data/lib/asciidoctor/standoc/cleanup_block.rb +0 -1
  10. data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -2
  11. data/lib/asciidoctor/standoc/cleanup_footnotes.rb +0 -1
  12. data/lib/asciidoctor/standoc/cleanup_inline.rb +117 -77
  13. data/lib/asciidoctor/standoc/cleanup_maths.rb +0 -1
  14. data/lib/asciidoctor/standoc/cleanup_ref.rb +7 -0
  15. data/lib/asciidoctor/standoc/cleanup_section.rb +73 -137
  16. data/lib/asciidoctor/standoc/cleanup_section_names.rb +75 -0
  17. data/lib/asciidoctor/standoc/cleanup_terms.rb +19 -18
  18. data/lib/asciidoctor/standoc/converter.rb +1 -0
  19. data/lib/asciidoctor/standoc/front.rb +1 -2
  20. data/lib/asciidoctor/standoc/front_contributor.rb +66 -42
  21. data/lib/asciidoctor/standoc/inline.rb +45 -34
  22. data/lib/asciidoctor/standoc/isodoc.rng +66 -10
  23. data/lib/asciidoctor/standoc/macros.rb +7 -5
  24. data/lib/asciidoctor/standoc/macros_plantuml.rb +21 -23
  25. data/lib/asciidoctor/standoc/macros_terms.rb +60 -23
  26. data/lib/asciidoctor/standoc/section.rb +19 -12
  27. data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +87 -33
  28. data/lib/asciidoctor/standoc/terms.rb +1 -1
  29. data/lib/asciidoctor/standoc/utils.rb +0 -1
  30. data/lib/asciidoctor/standoc/validate.rb +22 -8
  31. data/lib/isodoc/html/html_titlepage.html +81 -0
  32. data/lib/isodoc/html/htmlstyle.css +983 -0
  33. data/lib/isodoc/html/htmlstyle.scss +714 -0
  34. data/lib/isodoc/html/scripts.html +71 -0
  35. data/lib/metanorma/standoc/processor.rb +16 -7
  36. data/lib/metanorma/standoc/version.rb +1 -1
  37. data/metanorma-standoc.gemspec +3 -3
  38. data/spec/asciidoctor/base_spec.rb +697 -557
  39. data/spec/asciidoctor/blocks_spec.rb +6 -8
  40. data/spec/asciidoctor/cleanup_sections_spec.rb +14 -14
  41. data/spec/asciidoctor/cleanup_spec.rb +899 -688
  42. data/spec/asciidoctor/inline_spec.rb +62 -14
  43. data/spec/asciidoctor/isobib_cache_spec.rb +4 -6
  44. data/spec/asciidoctor/lists_spec.rb +149 -137
  45. data/spec/asciidoctor/macros_json2text_spec.rb +1 -1
  46. data/spec/asciidoctor/macros_plantuml_spec.rb +8 -8
  47. data/spec/asciidoctor/macros_spec.rb +646 -169
  48. data/spec/asciidoctor/refs_dl_spec.rb +4 -4
  49. data/spec/asciidoctor/refs_spec.rb +1527 -1532
  50. data/spec/asciidoctor/section_spec.rb +58 -22
  51. data/spec/asciidoctor/table_spec.rb +6 -6
  52. data/spec/asciidoctor/validate_spec.rb +352 -304
  53. data/spec/spec_helper.rb +2 -0
  54. data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +49 -49
  55. data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
  56. data/spec/vcr_cassettes/isobib_get_123_1.yml +27 -27
  57. data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +35 -35
  58. data/spec/vcr_cassettes/isobib_get_123_2001.yml +14 -14
  59. data/spec/vcr_cassettes/isobib_get_124.yml +14 -14
  60. data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +14 -14
  61. data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +44 -44
  62. metadata +12 -11
  63. data/lib/liquid/custom_blocks/key_iterator.rb +0 -21
  64. data/lib/liquid/custom_blocks/with_json_nested_context.rb +0 -18
  65. data/lib/liquid/custom_blocks/with_yaml_nested_context.rb +0 -19
  66. data/lib/liquid/custom_filters/values.rb +0 -7
@@ -198,7 +198,7 @@ RSpec.describe Asciidoctor::Standoc do
198
198
  </indexsect>
199
199
  </standard-document>
200
200
  OUTPUT
201
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
201
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
202
202
  .to be_equivalent_to xmlpp(output)
203
203
  end
204
204
 
@@ -339,7 +339,7 @@ RSpec.describe Asciidoctor::Standoc do
339
339
  </bibliography>
340
340
  </standard-document>
341
341
  OUTPUT
342
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
342
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
343
343
  .to be_equivalent_to xmlpp(output)
344
344
  end
345
345
 
@@ -544,7 +544,7 @@ RSpec.describe Asciidoctor::Standoc do
544
544
  </clause></bibliography>
545
545
  </standard-document>
546
546
  OUTPUT
547
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
547
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
548
548
  .to be_equivalent_to xmlpp(output)
549
549
  end
550
550
 
@@ -682,7 +682,7 @@ RSpec.describe Asciidoctor::Standoc do
682
682
  </bibliography>
683
683
  </standard-document>
684
684
  OUTPUT
685
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
685
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
686
686
  .to be_equivalent_to xmlpp(output)
687
687
  end
688
688
 
@@ -698,8 +698,8 @@ RSpec.describe Asciidoctor::Standoc do
698
698
 
699
699
  INPUT
700
700
  output = <<~OUTPUT
701
- #{BLANK_HDR}
702
- <sections>
701
+ #{BLANK_HDR}
702
+ <sections>
703
703
  <terms id='_' obligation='normative'>
704
704
  <title>Terms, definitions and symbols</title>
705
705
  <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
@@ -713,7 +713,7 @@ RSpec.describe Asciidoctor::Standoc do
713
713
  </sections>
714
714
  </standard-document>
715
715
  OUTPUT
716
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
716
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
717
717
  .to be_equivalent_to xmlpp(output)
718
718
  end
719
719
 
@@ -745,7 +745,43 @@ RSpec.describe Asciidoctor::Standoc do
745
745
  </sections>
746
746
  </standard-document>
747
747
  OUTPUT
748
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
748
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
749
+ .to be_equivalent_to xmlpp(output)
750
+ end
751
+
752
+ it "varies terms symbols & abbreviated terms title" do
753
+ input = <<~INPUT
754
+ #{ASCIIDOC_BLANK_HDR}
755
+ [heading="terms, definitions, symbols and abbreviated terms"]
756
+ == Terms, Definitions, Abbreviated Terms Section
757
+
758
+ === Term
759
+
760
+ === Abbreviated Terms
761
+
762
+ === Symbols
763
+
764
+ INPUT
765
+ output = <<~OUTPUT
766
+ #{BLANK_HDR}
767
+ <sections>
768
+ <terms id='_' obligation='normative'>
769
+ <title>Terms, definitions, symbols and abbreviated terms</title>
770
+ <p id='_'>For the purposes of this document, the following terms and definitions apply.</p>
771
+ <term id='term-term'>
772
+ <preferred>Term</preferred>
773
+ </term>
774
+ <definitions id='_' type='abbreviated_terms' obligation='normative'>
775
+ <title>Abbreviated terms</title>
776
+ </definitions>
777
+ <definitions id='_' type='symbols' obligation='normative'>
778
+ <title>Symbols</title>
779
+ </definitions>
780
+ </terms>
781
+ </sections>
782
+ </standard-document>
783
+ OUTPUT
784
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
749
785
  .to be_equivalent_to xmlpp(output)
750
786
  end
751
787
 
@@ -779,7 +815,7 @@ RSpec.describe Asciidoctor::Standoc do
779
815
  </annex>
780
816
  </standard-document>
781
817
  OUTPUT
782
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
818
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
783
819
  .to be_equivalent_to xmlpp(output)
784
820
  end
785
821
 
@@ -813,7 +849,7 @@ RSpec.describe Asciidoctor::Standoc do
813
849
  </annex>
814
850
  </standard-document>
815
851
  OUTPUT
816
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
852
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
817
853
  .to be_equivalent_to xmlpp(output)
818
854
  end
819
855
 
@@ -836,7 +872,7 @@ RSpec.describe Asciidoctor::Standoc do
836
872
  </sections>
837
873
  </standard-document>
838
874
  OUTPUT
839
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
875
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
840
876
  .to be_equivalent_to xmlpp(output)
841
877
  end
842
878
 
@@ -867,7 +903,7 @@ RSpec.describe Asciidoctor::Standoc do
867
903
  </sections>
868
904
  </standard-document>
869
905
  OUTPUT
870
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
906
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
871
907
  .to be_equivalent_to xmlpp(output)
872
908
  end
873
909
 
@@ -899,7 +935,7 @@ RSpec.describe Asciidoctor::Standoc do
899
935
  </terms></sections>
900
936
  </standard-document>
901
937
  OUTPUT
902
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
938
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
903
939
  .to be_equivalent_to xmlpp(output)
904
940
  end
905
941
 
@@ -925,7 +961,7 @@ RSpec.describe Asciidoctor::Standoc do
925
961
  </standard-document>
926
962
 
927
963
  OUTPUT
928
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
964
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
929
965
  .to be_equivalent_to xmlpp(output)
930
966
  end
931
967
 
@@ -953,7 +989,7 @@ RSpec.describe Asciidoctor::Standoc do
953
989
  </terms></sections>
954
990
  </standard-document>
955
991
  OUTPUT
956
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
992
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
957
993
  .to be_equivalent_to xmlpp(output)
958
994
  end
959
995
 
@@ -986,7 +1022,7 @@ RSpec.describe Asciidoctor::Standoc do
986
1022
  </terms></sections>
987
1023
  </standard-document>
988
1024
  OUTPUT
989
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
1025
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
990
1026
  .to be_equivalent_to xmlpp(output)
991
1027
  end
992
1028
 
@@ -1018,7 +1054,7 @@ RSpec.describe Asciidoctor::Standoc do
1018
1054
  </terms></sections>
1019
1055
  </standard-document>
1020
1056
  OUTPUT
1021
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
1057
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1022
1058
  .to be_equivalent_to xmlpp(output)
1023
1059
  end
1024
1060
 
@@ -1030,7 +1066,7 @@ RSpec.describe Asciidoctor::Standoc do
1030
1066
  == Terms and Definitions
1031
1067
  === Term2
1032
1068
  INPUT
1033
- expect { Asciidoctor.convert(input, backend: :standoc, header_footer: true) }
1069
+ expect { Asciidoctor.convert(input, *OPTIONS) }
1034
1070
  .to output(/not referenced/).to_stderr
1035
1071
  end
1036
1072
 
@@ -1062,7 +1098,7 @@ RSpec.describe Asciidoctor::Standoc do
1062
1098
  </sections>
1063
1099
  </standard-document>
1064
1100
  OUTPUT
1065
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
1101
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1066
1102
  .to be_equivalent_to xmlpp(output)
1067
1103
  end
1068
1104
 
@@ -1124,7 +1160,7 @@ RSpec.describe Asciidoctor::Standoc do
1124
1160
  </sections>
1125
1161
  </standard-document>
1126
1162
  OUTPUT
1127
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
1163
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1128
1164
  .to be_equivalent_to xmlpp(output)
1129
1165
  end
1130
1166
 
@@ -1171,7 +1207,7 @@ RSpec.describe Asciidoctor::Standoc do
1171
1207
  </annex>
1172
1208
  </standard-document>
1173
1209
  OUTPUT
1174
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
1210
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1175
1211
  .to be_equivalent_to xmlpp(output)
1176
1212
  end
1177
1213
 
@@ -1190,7 +1226,7 @@ RSpec.describe Asciidoctor::Standoc do
1190
1226
  </sections>
1191
1227
  </standard-document>
1192
1228
  OUTPUT
1193
- expect(xmlpp(strip_guid(Asciidoctor.convert(input, backend: :standoc, header_footer: true))))
1229
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
1194
1230
  .to be_equivalent_to xmlpp(output)
1195
1231
  end
1196
1232
 
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::Standoc do
4
4
  it "processes basic tables" do
5
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
5
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  .Table Name
8
8
  |===
@@ -36,7 +36,7 @@ RSpec.describe Asciidoctor::Standoc do
36
36
  end
37
37
 
38
38
  it "processes table widths" do
39
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
39
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
40
40
  #{ASCIIDOC_BLANK_HDR}
41
41
  [width=75%]
42
42
  |===
@@ -96,7 +96,7 @@ RSpec.describe Asciidoctor::Standoc do
96
96
  end
97
97
 
98
98
  it "processes column widths in tables" do
99
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
99
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
100
100
  #{ASCIIDOC_BLANK_HDR}
101
101
  [cols=".<,.^,^.>"]
102
102
  |===
@@ -182,7 +182,7 @@ RSpec.describe Asciidoctor::Standoc do
182
182
 
183
183
 
184
184
  it "inserts header rows in a table with a name and no header" do
185
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
185
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
186
186
  #{ASCIIDOC_BLANK_HDR}
187
187
  [headerrows=2]
188
188
  .Table Name
@@ -222,7 +222,7 @@ RSpec.describe Asciidoctor::Standoc do
222
222
 
223
223
 
224
224
  it "inserts header rows in a table without a name and no header" do
225
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
225
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
226
226
  #{ASCIIDOC_BLANK_HDR}
227
227
  [headerrows=2]
228
228
  |===
@@ -258,7 +258,7 @@ RSpec.describe Asciidoctor::Standoc do
258
258
  end
259
259
 
260
260
  it "processes complex tables" do
261
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
261
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
262
262
  #{ASCIIDOC_BLANK_HDR}
263
263
  [cols="<.^,^.<,^.>,^,^",options="header,footer",headerrows=2,alt="An extensive summary, and illustration, of tables",subsequence="A",options="unnumbered",summary="This is an extremely long, convoluted summary",width=70%,number="3",keep-with-next=true,keep-lines-together=true]
264
264
  .Maximum _permissible_ mass fraction of defects
@@ -4,38 +4,45 @@ require "fileutils"
4
4
 
5
5
  RSpec.describe Asciidoctor::Standoc do
6
6
  it "generates error file" do
7
- FileUtils.rm_f "spec/assets/xref_error.err"
8
- Asciidoctor.convert_file "spec/assets/xref_error.adoc", {:attributes=>{"backend"=>"standoc"}, :safe=>0, :header_footer=>true, :requires=>["metanorma-standoc"], :failure_level=>4, :mkdirs=>true, :to_file=>nil}
9
- expect(File.exist?("spec/assets/xref_error.err")).to be true
7
+ FileUtils.rm_f "spec/assets/xref_error.err"
8
+ Asciidoctor.convert_file "spec/assets/xref_error.adoc",
9
+ { attributes: { "backend" => "standoc" }, safe: 0,
10
+ header_footer: true,
11
+ requires: ["metanorma-standoc"],
12
+ failure_level: 4, mkdirs: true, to_file: nil }
13
+ expect(File.exist?("spec/assets/xref_error.err")).to be true
10
14
  end
11
15
 
12
16
  it "provides context for log" do
13
- FileUtils.rm_f "test.xml"
14
- FileUtils.rm_f "test.err"
15
- begin
16
- expect { Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true) }.to raise_error(SystemExit)
17
- = Document title
18
- Author
19
- :docfile: test.adoc
20
- :nodoc:
21
-
22
- [[abc]]
23
- == Clause 1
24
-
25
- [[abc]]
26
- == Clause 2
27
- INPUT
28
- rescue SystemExit
17
+ FileUtils.rm_f "test.xml"
18
+ FileUtils.rm_f "test.err"
19
+ begin
20
+ input = <<~INPUT
21
+ = Document title
22
+ Author
23
+ :docfile: test.adoc
24
+ :nodoc:
25
+
26
+ [[abc]]
27
+ == Clause 1
28
+
29
+ [[abc]]
30
+ == Clause 2
31
+ INPUT
32
+ expect { Asciidoctor.convert(input, *OPTIONS) }.to raise_error(SystemExit)
33
+ rescue SystemExit
34
+ end
35
+ expect(File.read("test.err"))
36
+ .to include "Anchor abc has already been used at line"
37
+ expect(File.read("test.err"))
38
+ .to include %(\t<clause id="abc" inline-header="false" obligation="normative">)
29
39
  end
30
- expect(File.read("test.err")).to include "Anchor abc has already been used at line"
31
- expect(File.read("test.err")).to include %(\t<clause id="abc" inline-header="false" obligation="normative">)
32
- end
33
40
 
34
41
  it "warns about missing fields in asciibib" do
35
- FileUtils.rm_f "test.err"
36
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
42
+ FileUtils.rm_f "test.err"
43
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
37
44
  #{VALIDATING_BLANK_HDR}
38
-
45
+
39
46
  [bibliography]
40
47
  == Normative References
41
48
 
@@ -43,7 +50,7 @@ end
43
50
  === Standard
44
51
  id:: iso123
45
52
  type:: standard
46
- contributor::
53
+ contributor::
47
54
  role::: publisher
48
55
  organization:::
49
56
  name:::: ISO
@@ -62,17 +69,17 @@ end
62
69
  person:::
63
70
  name::::
64
71
  completename::::: Jack
65
-
66
72
  INPUT
67
- errf = File.read("test.err")
68
- expect(errf).to include "Reference iso123 is missing a document identifier (docid)"
73
+ errf = File.read("test.err")
74
+ expect(errf)
75
+ .to include "Reference iso123 is missing a document identifier (docid)"
69
76
  end
70
77
 
71
- it "warns about missing fields in asciibib" do
72
- FileUtils.rm_f "test.err"
73
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
78
+ it "warns about missing fields in asciibib" do
79
+ FileUtils.rm_f "test.err"
80
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
74
81
  #{VALIDATING_BLANK_HDR}
75
-
82
+
76
83
  [bibliography]
77
84
  == Normative References
78
85
 
@@ -83,10 +90,10 @@ end
83
90
  role::: publisher
84
91
  organization:::
85
92
  name:::: ISO
86
- INPUT
87
- errf = File.read("test.err")
88
- expect(errf).to include "The following reference is missing an anchor"
89
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
93
+ INPUT
94
+ errf = File.read("test.err")
95
+ expect(errf).to include "The following reference is missing an anchor"
96
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
90
97
  #{VALIDATING_BLANK_HDR}
91
98
 
92
99
  [bibliography]
@@ -100,89 +107,85 @@ INPUT
100
107
  role::: publisher
101
108
  organization:::
102
109
  name:::: ISO
103
- INPUT
104
- errf = File.read("test.err")
105
- expect(errf).not_to include "The following reference is missing an anchor"
106
- end
107
-
108
- =begin
109
- it "warns about malformed LaTeX" do
110
- FileUtils.rm_f "test.err"
111
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
112
- #{VALIDATING_BLANK_HDR}
113
-
114
- == Clause 1
115
-
116
- latexmath:[\\[ \\text{Odd integer = 51, \\quad \\text{Even integers } = 50 \\]]
117
-
118
- === Clause 1.1
119
-
120
- Subclause
121
- INPUT
122
- expect(File.read("test.err")).to include "latexmlmath failed to process equation"
110
+ INPUT
111
+ errf = File.read("test.err")
112
+ expect(errf).not_to include "The following reference is missing an anchor"
123
113
  end
124
- =end
125
-
126
- =begin
127
- it "warns about reparsing LaTeX" do
128
- FileUtils.rm_f "test.err"
129
- expect { Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true) }.to output(/Retrying/).to_stderr
130
- #{VALIDATING_BLANK_HDR}
131
-
132
- == Clause 1
133
-
134
- [latexmath]
135
- ++++
136
- \\pmatrix{ \\hat{e}_{\\xi} \\cr \\hat{e}_{\\eta}
137
- \\cr \\hat{e}_{\\zeta} } = {\\bf T} \\pmatrix{ \\hat{e}_x \\cr \\hat{e}_y \\cr \\hat{e}_z },
138
- ++++
139
114
 
140
- === Clause 1.1
141
-
142
- Subclause
143
- INPUT
144
- end
145
- =end
115
+ # it "warns about malformed LaTeX" do
116
+ # FileUtils.rm_f "test.err"
117
+ # Asciidoctor.convert(<<~"INPUT", *OPTIONS)
118
+ # #{VALIDATING_BLANK_HDR}
119
+ #
120
+ # == Clause 1
121
+ #
122
+ # latexmath:[\\[ \\text{Odd integer = 51, \\quad \\text{Even integers } = 50 \\]]
123
+ #
124
+ # === Clause 1.1
125
+ #
126
+ # Subclause
127
+ # INPUT
128
+ # expect(File.read("test.err")).to include "latexmlmath failed to process equation"
129
+ # end
130
+
131
+ # it "warns about reparsing LaTeX" do
132
+ # FileUtils.rm_f "test.err"
133
+ # expect { Asciidoctor.convert(<<~"INPUT", *OPTIONS) }.to output(/Retrying/).to_stderr
134
+ # #{VALIDATING_BLANK_HDR}
135
+ #
136
+ # == Clause 1
137
+ #
138
+ # [latexmath]
139
+ # ++++
140
+ # \\pmatrix{ \\hat{e}_{\\xi} \\cr \\hat{e}_{\\eta}
141
+ # \\cr \\hat{e}_{\\zeta} } = {\\bf T} \\pmatrix{ \\hat{e}_x \\cr \\hat{e}_y \\cr \\hat{e}_z },
142
+ # ++++
143
+ #
144
+ # === Clause 1.1
145
+ #
146
+ # Subclause
147
+ # INPUT
148
+ # end
146
149
 
147
150
  it "warns about hanging paragraphs" do
148
- FileUtils.rm_f "test.err"
149
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
150
- #{VALIDATING_BLANK_HDR}
151
+ FileUtils.rm_f "test.err"
152
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
153
+ #{VALIDATING_BLANK_HDR}
151
154
 
152
- == Clause 1
155
+ == Clause 1
153
156
 
154
- Paragraph
157
+ Paragraph
155
158
 
156
- === Clause 1.1
159
+ === Clause 1.1
157
160
 
158
- Subclause
159
- INPUT
160
- expect(File.read("test.err")).to include "Hanging paragraph in clause"
161
+ Subclause
162
+ INPUT
163
+ expect(File.read("test.err")).to include "Hanging paragraph in clause"
161
164
  end
162
165
 
163
166
  it "warns that video is a skipped node" do
164
- FileUtils.rm_f "test.err"
165
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
166
- #{VALIDATING_BLANK_HDR}
167
+ FileUtils.rm_f "test.err"
168
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
169
+ #{VALIDATING_BLANK_HDR}
167
170
 
168
- video::video_file.mp4[]
169
- INPUT
170
- expect(File.read("test.err")).to include "converter missing for video node"
171
+ video::video_file.mp4[]
172
+ INPUT
173
+ expect(File.read("test.err")).to include "converter missing for video node"
171
174
  end
172
175
 
173
- it "warns that figure does not have title" do
174
- FileUtils.rm_f "test.err"
175
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
176
- #{VALIDATING_BLANK_HDR}
176
+ it "warns that figure does not have title" do
177
+ FileUtils.rm_f "test.err"
178
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
179
+ #{VALIDATING_BLANK_HDR}
177
180
 
178
- image::spec/examples/rice_images/rice_image1.png[]
179
- INPUT
180
- expect(File.read("test.err")).to include "Figure should have title"
181
- end
181
+ image::spec/examples/rice_images/rice_image1.png[]
182
+ INPUT
183
+ expect(File.read("test.err")).to include "Figure should have title"
184
+ end
182
185
 
183
- it "warns that callouts do not match annotations" do
184
- FileUtils.rm_f "test.err"
185
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
186
+ it "warns that callouts do not match annotations" do
187
+ FileUtils.rm_f "test.err"
188
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
186
189
  #{VALIDATING_BLANK_HDR}
187
190
  [source,ruby]
188
191
  --
@@ -193,226 +196,271 @@ it "warns that callouts do not match annotations" do
193
196
  --
194
197
  <1> This is one callout
195
198
  <2> This is another callout
196
- INPUT
197
- expect(File.read("test.err")).to include "mismatch of callouts and annotations"
198
- end
199
+ INPUT
200
+ expect(File.read("test.err"))
201
+ .to include "mismatch of callouts and annotations"
202
+ end
199
203
 
200
- it "warns that term source is not a real reference" do
201
- FileUtils.rm_f "test.err"
202
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
203
- #{VALIDATING_BLANK_HDR}
204
+ it "warns that term source is not a real reference" do
205
+ FileUtils.rm_f "test.err"
206
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
207
+ #{VALIDATING_BLANK_HDR}
204
208
 
205
- [.source]
206
- <<iso123>>
207
- INPUT
208
- expect(File.read("test.err")).to include "iso123 does not have a corresponding anchor ID in the bibliography"
209
- end
209
+ [.source]
210
+ <<iso123>>
211
+ INPUT
212
+ expect(File.read("test.err"))
213
+ .to include "iso123 does not have a corresponding anchor ID in the bibliography"
214
+ end
210
215
 
211
- it "warns of Non-reference in bibliography" do
212
- FileUtils.rm_f "test.err"
213
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
214
- #{VALIDATING_BLANK_HDR}
216
+ it "warns of Non-reference in bibliography" do
217
+ FileUtils.rm_f "test.err"
218
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
219
+ #{VALIDATING_BLANK_HDR}
215
220
 
216
- == Normative References
217
- * I am not a reference
218
- INPUT
219
- expect(File.read("test.err")).to include "no anchor on reference"
220
- end
221
+ == Normative References
222
+ * I am not a reference
223
+ INPUT
224
+ expect(File.read("test.err")).to include "no anchor on reference"
225
+ end
221
226
 
222
- it "warns that Table should have title" do
223
- FileUtils.rm_f "test.err"
224
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
225
- #{VALIDATING_BLANK_HDR}
227
+ it "warns that Table should have title" do
228
+ FileUtils.rm_f "test.err"
229
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
230
+ #{VALIDATING_BLANK_HDR}
226
231
 
227
- |===
228
- |a |b |c
229
- |===
230
- INPUT
231
- expect(File.read("test.err")).to include "Table should have title"
232
- end
232
+ |===
233
+ |a |b |c
234
+ |===
235
+ INPUT
236
+ expect(File.read("test.err")).to include "Table should have title"
237
+ end
233
238
 
234
- it "validates document against ISO XML schema" do
235
- FileUtils.rm_f "test.err"
236
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
237
- #{VALIDATING_BLANK_HDR}
239
+ it "validates document against ISO XML schema" do
240
+ FileUtils.rm_f "test.err"
241
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
242
+ #{VALIDATING_BLANK_HDR}
238
243
 
239
- [align=mid-air]
240
- Para
241
- INPUT
242
- expect(File.read("test.err")).to include 'value of attribute "align" is invalid; must be equal to'
243
- end
244
+ [align=mid-air]
245
+ Para
246
+ INPUT
247
+ expect(File.read("test.err"))
248
+ .to include 'value of attribute "align" is invalid; must be equal to'
249
+ end
244
250
 
245
- it "Warning if terms mismatches IEV" do
246
- FileUtils.rm_f "test.err"
247
- FileUtils.mv File.expand_path("~/.iev/cache"), File.expand_path("~/.iev.pstore1"), force: true
248
- FileUtils.rm_f "test_iev/pstore"
249
- mock_open_uri('103-01-02')
250
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
251
- = Document title
252
- Author
253
- :docfile: test.adoc
254
-
255
- [bibliography]
256
- == Normative References
257
- * [[[iev,IEV]]], _iev_
258
-
259
- == Terms and definitions
260
- === Automation
261
-
262
- [.source]
263
- <<iev,clause="103-01-02">>
264
- INPUT
265
- expect(File.read("test.err")).to include 'Term "automation" does not match IEV 103-01-02 "functional"'
266
- FileUtils.mv File.expand_path("~/.iev.pstore1"), File.expand_path("~/.iev/cache"), force: true
267
- end
251
+ it "Warning if terms mismatches IEV" do
252
+ FileUtils.rm_f "test.err"
253
+ FileUtils.mv File.expand_path("~/.iev/cache"),
254
+ File.expand_path("~/.iev.pstore1"), force: true
255
+ FileUtils.rm_f "test_iev/pstore"
256
+ mock_open_uri("103-01-02")
257
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
258
+ = Document title
259
+ Author
260
+ :docfile: test.adoc
268
261
 
269
- it "No warning if English term matches IEV" do
270
- FileUtils.rm_f "test.err"
271
- FileUtils.mv File.expand_path("~/.iev/cache"), File.expand_path("~/.iev.pstore1"), force: true
272
- FileUtils.rm_f "test_iev/cache"
273
- mock_open_uri('103-01-02')
274
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
275
- = Document title
276
- Author
277
- :docfile: test.adoc
278
-
279
- [bibliography]
280
- == Normative References
281
- * [[[iev,IEV]]], _iev_
282
-
283
- == Terms and definitions
284
- === Functional
285
-
286
- [.source]
287
- <<iev,clause="103-01-02">>
288
- INPUT
289
- expect(File.read("test.err")).not_to include "does not match IEV 103-01-02"
290
- FileUtils.mv File.expand_path("~/.iev.pstore1"), File.expand_path("~/.iev/cache"), force: true
291
- end
262
+ [bibliography]
263
+ == Normative References
264
+ * [[[iev,IEV]]], _iev_
292
265
 
293
- it "No warning if French term matches IEV" do
294
- FileUtils.rm_f "test.err"
295
- FileUtils.mv File.expand_path("~/.iev/cache"), File.expand_path("~/.iev.pstore1"), force: true
296
- FileUtils.rm_f "test_iev/cache"
297
- mock_open_uri('103-01-02')
298
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
299
- = Document title
300
- Author
301
- :docfile: test.adoc
302
- :nodoc:
303
- :language: fr
304
-
305
- [bibliography]
306
- == Normative References
307
- * [[[iev,IEV]]], _iev_
308
-
309
- == Terms and definitions
310
- === Fonctionnelle, f
311
-
312
- [.source]
313
- <<iev,clause="103-01-02">>
314
- INPUT
315
- expect(File.read("test.err")).not_to include "does not match IEV 103-01-02"
316
- FileUtils.mv File.expand_path("~/.iev.pstore1"), File.expand_path("~/.iev/cache"), force: true
317
- end
266
+ == Terms and definitions
267
+ === Automation
318
268
 
319
- =begin
320
- it "No warning if attributes on formatted strong or stem extraneous to Metanomra XML" do
321
- expect { Asciidoctor::Standoc::Converter.new(nil,nil).validate(Nokogiri::XML(<<~INPUT)) }.not_to output('found attribute "close", but no attributes allowed here').to_stderr
322
- <standard-document>
323
- <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced open="(" close=")"><mi>r</mi></mfenced></stem>
324
- </standard-document>
325
- INPUT
326
- end
327
- =end
328
-
329
- it "warns and aborts if id used twice" do
330
- FileUtils.rm_f "test.xml"
331
- FileUtils.rm_f "test.err"
332
- begin
333
- expect { Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true) }.to raise_error(SystemExit)
334
- = Document title
335
- Author
336
- :docfile: test.adoc
337
- :nodoc:
338
-
339
- [[abc]]
340
- == Clause 1
341
-
342
- [[abc]]
343
- == Clause 2
344
- INPUT
345
- rescue SystemExit
269
+ [.source]
270
+ <<iev,clause="103-01-02">>
271
+ INPUT
272
+ expect(File.read("test.err"))
273
+ .to include 'Term "automation" does not match IEV 103-01-02 "functional"'
274
+ FileUtils.mv File.expand_path("~/.iev.pstore1"),
275
+ File.expand_path("~/.iev/cache"), force: true
346
276
  end
347
- expect(File.read("test.err")).to include "Anchor abc has already been used at line"
348
- expect(File.exist?("test.xml")).to be false
349
- end
350
277
 
351
- it "warns and aborts if numeric normative reference" do
352
- FileUtils.rm_f "test.xml"
353
- FileUtils.rm_f "test.err"
354
- begin
355
- expect { Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true) }.to raise_error(SystemExit)
356
- = Document title
357
- Author
358
- :docfile: test.adoc
359
- :nodoc:
360
-
361
- [bibliography]
362
- == Normative references
363
- * [[[A,1]]]
364
- INPUT
365
- rescue SystemExit
278
+ it "No warning if English term matches IEV" do
279
+ FileUtils.rm_f "test.err"
280
+ FileUtils.mv File.expand_path("~/.iev/cache"),
281
+ File.expand_path("~/.iev.pstore1"), force: true
282
+ FileUtils.rm_f "test_iev/cache"
283
+ mock_open_uri("103-01-02")
284
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
285
+ = Document title
286
+ Author
287
+ :docfile: test.adoc
288
+
289
+ [bibliography]
290
+ == Normative References
291
+ * [[[iev,IEV]]], _iev_
292
+
293
+ == Terms and definitions
294
+ === Functional
295
+
296
+ [.source]
297
+ <<iev,clause="103-01-02">>
298
+ INPUT
299
+ expect(File.read("test.err")).not_to include "does not match IEV 103-01-02"
300
+ FileUtils.mv File.expand_path("~/.iev.pstore1"),
301
+ File.expand_path("~/.iev/cache"), force: true
366
302
  end
367
- expect(File.read("test.err")).to include "Numeric reference in normative references"
368
- expect(File.exist?("test.xml")).to be false
369
- end
370
303
 
371
- it "err file succesfully created for docfile path" do
372
- FileUtils.rm_rf "test"
373
- FileUtils.mkdir_p "test"
374
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
375
- = Document title
376
- Author
377
- :docfile: test#{File::ALT_SEPARATOR || File::SEPARATOR}test.adoc
378
- :nodoc:
379
-
380
- == Clause 1
304
+ it "No warning if French term matches IEV" do
305
+ FileUtils.rm_f "test.err"
306
+ FileUtils.mv File.expand_path("~/.iev/cache"),
307
+ File.expand_path("~/.iev.pstore1"), force: true
308
+ FileUtils.rm_f "test_iev/cache"
309
+ mock_open_uri("103-01-02")
310
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
311
+ = Document title
312
+ Author
313
+ :docfile: test.adoc
314
+ :nodoc:
315
+ :language: fr
381
316
 
382
- Paragraph
317
+ [bibliography]
318
+ == Normative References
319
+ * [[[iev,IEV]]], _iev_
383
320
 
384
- === Clause 1.1
321
+ == Terms and definitions
322
+ === Fonctionnelle, f
385
323
 
386
- Subclause
387
- INPUT
324
+ [.source]
325
+ <<iev,clause="103-01-02">>
326
+ INPUT
327
+ expect(File.read("test.err"))
328
+ .not_to include "does not match IEV 103-01-02"
329
+ FileUtils.mv File.expand_path("~/.iev.pstore1"), File.expand_path("~/.iev/cache"), force: true
330
+ end
388
331
 
389
- expect(File.read("test/test.err")).to include "Hanging paragraph in clause"
390
- end
332
+ # it "No warning if attributes on formatted strong or stem extraneous to Metanomra XML" do
333
+ # expect { Asciidoctor::Standoc::Converter.new(nil,nil).validate(Nokogiri::XML(<<~INPUT)) }.not_to output('found attribute "close", but no attributes allowed here').to_stderr
334
+ # <standard-document>
335
+ # <stem type="MathML"><math xmlns="http://www.w3.org/1998/Math/MathML"><mfenced open="(" close=")"><mi>r</mi></mfenced></stem>
336
+ # </standard-document>
337
+ # INPUT
338
+ # end
391
339
 
392
- it "Warning if no block for footnoteblock" do
393
- FileUtils.rm_f "test.err"
394
- Asciidoctor.convert(<<~"INPUT", backend: :standoc, header_footer: true)
395
- = Document title
396
- Author
397
- :docfile: test.adoc
398
-
399
- footnoteblock:[id1]
400
-
401
- [[id2]]
402
- [NOTE]
403
- --
404
- |===
405
- |a |b
406
-
407
- |c |d
408
- |===
409
-
410
- * A
411
- * B
412
- * C
413
- --
414
- INPUT
415
- expect(File.read("test.err")).to include 'Could not resolve footnoteblock:[id1]'
416
- end
340
+ it "warns and aborts if concept/xref does not point to term or definition" do
341
+ FileUtils.rm_f "test.xml"
342
+ FileUtils.rm_f "test.err"
343
+ begin
344
+ input = <<~INPUT
345
+ = Document title
346
+ Author
347
+ :docfile: test.adoc
348
+ :nodoc:
349
+
350
+ [[abc]]
351
+ == Clause 1
352
+ [[ghi]]A:: B
353
+
354
+ == Symbols and Abbreviated Terms
355
+ [[def]]DEF:: def
356
+
357
+ {{<<abc>>,term}}
358
+ {{<<def>>,term}}
359
+ {{<<ghi>>,term}}
360
+ INPUT
361
+ expect { Asciidoctor.convert(input, *OPTIONS) }.to raise_error(SystemExit)
362
+ rescue SystemExit
363
+ end
364
+ expect(File.read("test.err"))
365
+ .to include "Concept term is pointing to abc, which is not a term or symbol"
366
+ expect(File.read("test.err"))
367
+ .not_to include "Concept term is pointing to def, which is not a term or symbol"
368
+ expect(File.read("test.err"))
369
+ .to include "Concept term is pointing to ghi, which is not a term or symbol"
370
+ expect(File.exist?("test.xml")).to be false
371
+ end
372
+
373
+ it "warns and aborts if id used twice" do
374
+ FileUtils.rm_f "test.xml"
375
+ FileUtils.rm_f "test.err"
376
+ begin
377
+ input = <<~INPUT
378
+ = Document title
379
+ Author
380
+ :docfile: test.adoc
381
+ :nodoc:
382
+
383
+ [[abc]]
384
+ == Clause 1
385
+
386
+ [[abc]]
387
+ == Clause 2
388
+ INPUT
389
+ expect { Asciidoctor.convert(input, *OPTIONS) }.to raise_error(SystemExit)
390
+ rescue SystemExit
391
+ end
392
+ expect(File.read("test.err"))
393
+ .to include "Anchor abc has already been used at line"
394
+ expect(File.exist?("test.xml")).to be false
395
+ end
396
+
397
+ it "warns and aborts if numeric normative reference" do
398
+ FileUtils.rm_f "test.xml"
399
+ FileUtils.rm_f "test.err"
400
+ begin
401
+ input = <<~INPUT
402
+ = Document title
403
+ Author
404
+ :docfile: test.adoc
405
+ :nodoc:
406
+
407
+ [bibliography]
408
+ == Normative references
409
+ * [[[A,1]]]
410
+ INPUT
411
+ expect { Asciidoctor.convert(input, *OPTIONS) }.to raise_error(SystemExit)
412
+ rescue SystemExit
413
+ end
414
+ expect(File.read("test.err"))
415
+ .to include "Numeric reference in normative references"
416
+ expect(File.exist?("test.xml")).to be false
417
+ end
418
+
419
+ it "err file succesfully created for docfile path" do
420
+ FileUtils.rm_rf "test"
421
+ FileUtils.mkdir_p "test"
422
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
423
+ = Document title
424
+ Author
425
+ :docfile: test#{File::ALT_SEPARATOR || File::SEPARATOR}test.adoc
426
+ :nodoc:
427
+
428
+ == Clause 1
429
+
430
+ Paragraph
417
431
 
432
+ === Clause 1.1
433
+
434
+ Subclause
435
+ INPUT
436
+
437
+ expect(File.read("test/test.err")).to include "Hanging paragraph in clause"
438
+ end
439
+
440
+ it "Warning if no block for footnoteblock" do
441
+ FileUtils.rm_f "test.err"
442
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
443
+ = Document title
444
+ Author
445
+ :docfile: test.adoc
446
+
447
+ footnoteblock:[id1]
448
+
449
+ [[id2]]
450
+ [NOTE]
451
+ --
452
+ |===
453
+ |a |b
454
+
455
+ |c |d
456
+ |===
457
+
458
+ * A
459
+ * B
460
+ * C
461
+ --
462
+ INPUT
463
+ expect(File.read("test.err"))
464
+ .to include "Could not resolve footnoteblock:[id1]"
465
+ end
418
466
  end