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.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/cleanup.rb +3 -1
- data/lib/metanorma/standoc/cleanup_block.rb +41 -1
- data/lib/metanorma/standoc/cleanup_terms.rb +6 -2
- data/lib/metanorma/standoc/isodoc.rng +10 -0
- data/lib/metanorma/standoc/ref_utility.rb +4 -5
- data/lib/metanorma/standoc/section.rb +2 -0
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +1 -1
- data/lib/metanorma/standoc/utils.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/spec/metanorma/blocks_spec.rb +50 -0
- data/spec/metanorma/cleanup_blocks_spec.rb +83 -0
- data/spec/metanorma/isobib_cache_spec.rb +6 -4
- data/spec/metanorma/macros_spec.rb +4 -2
- data/spec/metanorma/refs_spec.rb +261 -230
- data/spec/metanorma/validate_spec.rb +60 -1
- data/spec/vcr_cassettes/isobib_get_123_2.yml +295 -0
- data/spec/vcr_cassettes/std-link.yml +13 -71
- metadata +3 -2
@@ -498,7 +498,9 @@ RSpec.describe Metanorma::Standoc do
|
|
498
498
|
| a | a | a | a
|
499
499
|
|===
|
500
500
|
INPUT
|
501
|
-
expect
|
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
|