metanorma-standoc 2.1.4 → 2.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -498,7 +498,9 @@ RSpec.describe Metanorma::Standoc do
498
498
  | a | a | a | a
499
499
  |===
500
500
  INPUT
501
- expect { Asciidoctor.convert(input, *OPTIONS) }.not_to raise_error(SystemExit)
501
+ expect do
502
+ Asciidoctor.convert(input, *OPTIONS)
503
+ end.not_to raise_error(SystemExit)
502
504
  rescue SystemExit
503
505
  end
504
506
  expect(File.read("test.err"))
@@ -683,4 +685,61 @@ RSpec.describe Metanorma::Standoc do
683
685
  expect(File.read("test.err"))
684
686
  .to include "Metadata definition list does not follow a term designation"
685
687
  end
688
+
689
+ it "Warning if related term missing" do
690
+ FileUtils.rm_f "test.err"
691
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
692
+ #{VALIDATING_BLANK_HDR}
693
+
694
+ == Terms and definitions
695
+
696
+ === Term 1
697
+
698
+ related:see[xyz]
699
+
700
+ Definition
701
+
702
+ INPUT
703
+ expect(File.read("test.err"))
704
+ .to include "Error: Term reference to `xyz` missing:"
705
+
706
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
707
+ #{VALIDATING_BLANK_HDR}
708
+
709
+ == Terms and definitions
710
+
711
+ === Term 1
712
+
713
+ symbol:[xyz]
714
+
715
+ Definition
716
+
717
+ INPUT
718
+ expect(File.read("test.err"))
719
+ .to include "Symbol reference in `symbol[xyz]` missing:"
720
+
721
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
722
+ #{VALIDATING_BLANK_HDR}
723
+
724
+ == Terms and definitions
725
+
726
+ === Term 1
727
+
728
+ related:see[xyz]
729
+ symbol:[xyz1]
730
+
731
+ Definition
732
+
733
+ === xyz
734
+
735
+ == Symbols and abbreviated terms
736
+
737
+ xyz1:: B
738
+
739
+ INPUT
740
+ expect(File.read("test.err"))
741
+ .not_to include "Error: Term reference to `xyz` missing:"
742
+ expect(File.read("test.err"))
743
+ .not_to include "Symbol reference in `symbol[xyz]` missing:"
744
+ end
686
745
  end