require "spec_helper" require "relaton_iso" require "relaton_ietf" RSpec.describe Metanorma::Standoc do it "processes simple ISO reference" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[iso123,ISO 123]]] _Standard_ * [[[iso124,(1)ISO 123]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Standard ISO 123 123 ISO Standard [1] ISO 123 123 ISO OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes simple ISO reference with date range" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[iso123,ISO 123:1066-1067]]] _Standard_ * [[[iso124,(1)ISO 123:1066-1067]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Standard ISO 123:1066-1067 123 1066 1067 ISO Standard [1] ISO 123:1066-1067 123 1066 1067 ISO OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "repairs simple fetched ISO reference" do mock_isobib_get_123_no_docid(2) mock_isobib_get_123_no_docid_lbl(2) input = <<~"INPUT" #{ISOBIB_BLANK_HDR} <> <> [bibliography] == Normative References * [[[iso123,ISO 123]]] _Standard_ * [[[iso124,(1)ISO 123]]] _Standard_ INPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(<<~"OUTPUT") #{BLANK_HDR} Foreword

Normative references #{NORM_REF_BOILERPLATE} https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss 2001 International Organization for Standardization ISO www.iso.org 3 en fr Published 2001 ISO ISO 123:1985 ISO 123:2001 ISO 123 <em>Standard</em> https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss 2001 International Organization for Standardization ISO www.iso.org 3 en fr Published 2001 ISO ISO 123:1985 ISO 123:2001 ISO 123 [1] <em>Standard</em> OUTPUT expect do Asciidoctor.convert(input, *OPTIONS) end.to output(/ERROR: No document identifier retrieved for ISO 123/) .to_stderr end it "customises docidentifier by language" do mock_rfcbib_get_rfc8342(3) mock_rfcbib_get_rfc8343(3) input = <<~"INPUT" #{ISOBIB_BLANK_HDR} <> <> [bibliography] == Normative References * [[[iso123,ISO 8342]]] _Standard_ * [[[iso124,ISO 8343]]] _Standard_ INPUT doc = Asciidoctor.convert(input .sub(/:novalid:/, ":language: de\n:novalid:"), *OPTIONS) expect(doc).to include '' expect(doc).to include '' doc = Asciidoctor.convert(input .sub(/:novalid:/, ":language: fr\n:novalid:"), *OPTIONS) expect(doc).to include '' expect(doc).to include '' doc = Asciidoctor.convert(input .sub(/:novalid:/, ":language: en\n:novalid:"), *OPTIONS) expect(doc).to include '' expect(doc).to include '' end it "fetches simple ISO reference" do VCR.use_cassette "isobib_get_123_1" do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso123,ISO 123]]] _Standard_ * [[[iso124,(1)ISO 123]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123 urn:iso:std:iso:123:stage-90.93:ed-3 123 International Organization for Standardization ISO www.iso.org 3 en 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123:2001 urn:iso:std:iso:123:stage-90.93:ed-3 123 2001-05 International Organization for Standardization ISO www.iso.org 3 en This International Standard specifies procedures for sampling natural rubber latex concentrate and for sampling synthetic rubber latices and artificial latices. It is also suitable for sampling rubber latex contained in drums, tank cars or tanks. The procedures may also be used for sampling plastics dispersions. 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Geneva Geneva Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123 [1] urn:iso:std:iso:123:stage-90.93:ed-3 123 International Organization for Standardization ISO www.iso.org 3 en 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123:2001 urn:iso:std:iso:123:stage-90.93:ed-3 123 2001-05 International Organization for Standardization ISO www.iso.org 3 en This International Standard specifies procedures for sampling natural rubber latex concentrate and for sampling synthetic rubber latices and artificial latices. It is also suitable for sampling rubber latex contained in drums, tank cars or tanks. The procedures may also be used for sampling plastics dispersions. 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Geneva Geneva OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end end it "fetches simple ISO reference in French" do VCR.use_cassette "isobib_get_123_1_fr" do input = <<~INPUT = Document title Author :docfile: test.adoc :nodoc: :novalid: :no-isobib-cache: :language: fr [bibliography] == Normative References * [[[iso123,ISO 123]]] _Standard_ * [[[iso124,(1)ISO 123]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR.sub(%r{en}, 'fr')} Références normatives

Les documents suivants cités dans le texte constituent, pour tout ou partie de leur contenu, des exigences du présent document. Pour les références datées, seule l’édition citée s’applique. Pour les références non datées, la dernière édition du document de référence s’applique (y compris les éventuels amendements).

Latex de caoutchouc Échantillonnage Latex de caoutchouc — Échantillonnage https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123 urn:iso:std:iso:123:stage-90.93:ed-3 123 International Organization for Standardization ISO www.iso.org 3 en fr 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Latex de caoutchouc Échantillonnage Latex de caoutchouc — Échantillonnage https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123:2001 urn:iso:std:iso:123:stage-90.93:ed-3 123 2001-05 International Organization for Standardization ISO www.iso.org 3 en fr La présente Norme internationale spécifie des méthodes d’échantillonnage pour des concentrés de latex de caoutchouc naturel et pour échantillonner des latex de caoutchouc synthétique et des latex artificiels. Elle s’applique également à l’échantillonnage de latex de caoutchouc contenus dans des fûts, citernes routières ou de stockage. Le mode opératoire peut aussi être utilisé pour l’échantillonnage de dispersions de plastiques. 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Geneva Geneva Latex de caoutchouc Échantillonnage Latex de caoutchouc — Échantillonnage https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123 [1] urn:iso:std:iso:123:stage-90.93:ed-3 123 International Organization for Standardization ISO www.iso.org 3 en fr 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Latex de caoutchouc Échantillonnage Latex de caoutchouc — Échantillonnage https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123:2001 urn:iso:std:iso:123:stage-90.93:ed-3 123 2001-05 International Organization for Standardization ISO www.iso.org 3 en fr La présente Norme internationale spécifie des méthodes d’échantillonnage pour des concentrés de latex de caoutchouc naturel et pour échantillonner des latex de caoutchouc synthétique et des latex artificiels. Elle s’applique également à l’échantillonnage de latex de caoutchouc contenus dans des fûts, citernes routières ou de stockage. Le mode opératoire peut aussi être utilisé pour l’échantillonnage de dispersions de plastiques. 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Geneva Geneva
OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end end it "processes simple IEC reference" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[iso123,IEC 123]]] _Standard_ * [[[iso124,(1)IEC 123]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Standard IEC 123 123 IEC Standard [1] IEC 123 123 IEC OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes dated ISO reference and joint ISO/IEC references" do VCR.use_cassette("dated_iso_ref_joint_iso_iec", match_requests_on: %i[method uri body]) do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso123,ISO/IEC TR 12382:1992]]] _Standard_ * [[[iso124,ISO 124:2014]]] _Standard_ * [[[iso125,(1)ISO/IEC TR 12382:1992]]] _Standard_ * [[[iso126,(1)ISO 124:2014]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Permuted index of the vocabulary of information technology Permuted index of the vocabulary of information technology https://www.iso.org/standard/21071.html https://www.iso.org/obp/ui/#!iso:std:21071:en https://www.iso.org/contents/data/standard/02/10/21071.detail.rss ISO/IEC TR 12382:1992 urn:iso:std:iso-iec:tr:12382:stage-90.93:ed-2 12382 1992-12 International Organization for Standardization ISO www.iso.org International Electrotechnical Commission IEC www.iec.ch 2 en Contains a permuted index of all terms included in the parts 1 — 28 of ISO 2382. If any of these parts has been revised, the present TR refers to the revision. 90 93 1992 ISO/IEC Geneva Latex, rubber Determination of total solids content Latex, rubber — Determination of total solids content https://www.iso.org/standard/61884.html https://www.iso.org/obp/ui/#!iso:std:61884:en https://www.iso.org/contents/data/standard/06/18/61884.detail.rss ISO 124:2014 urn:iso:std:iso:124:stage-90.93:ed-7 124 2014-03 International Organization for Standardization ISO www.iso.org 7 en ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber. 90 93 2014 ISO ISO 124:2011 ISO 124:2011 Geneva Permuted index of the vocabulary of information technology Permuted index of the vocabulary of information technology https://www.iso.org/standard/21071.html https://www.iso.org/obp/ui/#!iso:std:21071:en https://www.iso.org/contents/data/standard/02/10/21071.detail.rss ISO/IEC TR 12382:1992 [1] urn:iso:std:iso-iec:tr:12382:stage-90.93:ed-2 12382 1992-12 International Organization for Standardization ISO www.iso.org International Electrotechnical Commission IEC www.iec.ch 2 en Contains a permuted index of all terms included in the parts 1 — 28 of ISO 2382. If any of these parts has been revised, the present TR refers to the revision. 90 93 1992 ISO/IEC Geneva Latex, rubber Determination of total solids content Latex, rubber — Determination of total solids content https://www.iso.org/standard/61884.html https://www.iso.org/obp/ui/#!iso:std:61884:en https://www.iso.org/contents/data/standard/06/18/61884.detail.rss ISO 124:2014 [1] urn:iso:std:iso:124:stage-90.93:ed-7 124 2014-03 International Organization for Standardization ISO www.iso.org 7 en ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber. 90 93 2014 ISO ISO 124:2011 ISO 124:2011 Geneva OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end end it "declines to fetch individual references" do VCR.use_cassette "dated_iso_ref_joint_iso_iec1" do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso123,nofetch(ISO/IEC TR 12382:1992)]]] _Standard_ * [[[iso124,ISO 124:2014]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Standard ISO/IEC TR 12382:1992 12382 1992 Latex, rubber Determination of total solids content Latex, rubber — Determination of total solids content https://www.iso.org/standard/61884.html https://www.iso.org/obp/ui/#!iso:std:61884:en https://www.iso.org/contents/data/standard/06/18/61884.detail.rss ISO 124:2014 urn:iso:std:iso:124:stage-90.93:ed-7 124 2014-03 International Organization for Standardization ISO www.iso.org 7 en ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber. 90 93 2014 ISO ISO 124:2011 ISO 124:2011 Geneva OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end end it "suppress identifier on bibitem" do VCR.use_cassette "dated_iso_ref_joint_iso_iec1" do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso123,dropid(ABC)]]] _Standard_ * [[[iso124,dropid(ISO 124:2014)]]] _Standard_ INPUT doc = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS)) expect(doc.at("//xmlns:bibitem[@id = 'iso123']/@suppress_identifier")&.text) .to eq("true") expect(doc.at("//xmlns:bibitem[@id = 'iso124']/@suppress_identifier")&.text) .to eq("true") end end it "hides individual references" do VCR.use_cassette "hide_refs", match_requests_on: %i[method uri body] do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso123,hidden(ISO 124)]]] _Standard_ * [[[iso124,ISO 125]]] _Standard_ [bibliography] == Bibliography * [[[iso125,hidden(ISO 125)]]] _Standard_ * [[[iso126,hidden(XYZ)]]] _Standard_ * [[[iso127,ISO 124]]] _Standard_ * [[[iso128,ABC]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Natural rubber latex concentrate Determination of alkalinity Natural rubber latex concentrate — Determination of alkalinity https://www.iso.org/standard/72849.html https://www.iso.org/obp/ui/#!iso:std:72849:en https://www.iso.org/contents/data/standard/07/28/72849.detail.rss ISO 125 urn:iso:std:iso:125:stage-60.60:ed-7 125 International Organization for Standardization ISO www.iso.org 7 en 60 60 2020 ISO ISO 125:2011 ISO 125:2011 Natural rubber latex concentrate Determination of alkalinity Natural rubber latex concentrate — Determination of alkalinity https://www.iso.org/standard/72849.html https://www.iso.org/obp/ui/#!iso:std:72849:en https://www.iso.org/contents/data/standard/07/28/72849.detail.rss ISO 125:2020 urn:iso:std:iso:125:stage-60.60:ed-7 125 2020-02 International Organization for Standardization ISO www.iso.org 7 en This document specifies a method for the determination of the alkalinity of natural rubber latex concentrate. The method is not necessarily suitable for latices from natural sources other than Hevea brasiliensis or for synthetic rubber latices, compounded latex, vulcanized latex or artificial dispersions of rubber. NOTE A method for the determination of the alkalinity of polychloroprene latex is specified in ISO 13773. 60 60 2020 ISO ISO 125:2011 ISO 125:2011 Geneva Geneva Bibliography Latex, rubber Determination of total solids content Latex, rubber — Determination of total solids content https://www.iso.org/standard/61884.html https://www.iso.org/obp/ui/#!iso:std:61884:en https://www.iso.org/contents/data/standard/06/18/61884.detail.rss ISO 124 urn:iso:std:iso:124:stage-90.93:ed-7 124 International Organization for Standardization ISO www.iso.org 7 en 90 93 2014 ISO ISO 124:2011 ISO 124:2011 Latex, rubber Determination of total solids content Latex, rubber — Determination of total solids content https://www.iso.org/standard/61884.html https://www.iso.org/obp/ui/#!iso:std:61884:en https://www.iso.org/contents/data/standard/06/18/61884.detail.rss ISO 124:2014 urn:iso:std:iso:124:stage-90.93:ed-7 124 2014-03 International Organization for Standardization ISO www.iso.org 7 en ISO 124:2014 specifies methods for the determination of the total solids content of natural rubber field and concentrated latices and synthetic rubber latex. These methods are not necessarily suitable for latex from natural sources other than the Hevea brasiliensis, for vulcanized latex, for compounded latex, or for artificial dispersions of rubber. 90 93 2014 ISO ISO 124:2011 ISO 124:2011 Geneva Geneva Standard ABC OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end end it "processes draft ISO reference" do # stub_fetch_ref no_year: true, note: "The standard is in press" input = <<~INPUT #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[iso123,ISO 123:--]]] _Standard_ * [[[iso124,ISO 124:—]]]{blank}footnote:[The standard is in press] _Standard_ * [[[iso125,ISO 125:–]]], footnote:[The standard is in press] _Standard_ * [[[iso126,(1)ISO 123:--]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Standard ISO 123:— 123 ISO Standard ISO 124:— 124 ISO The standard is in press Standard ISO 125:— 125 ISO The standard is in press Standard [1] ISO 123:— 123 ISO OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes all-parts ISO reference" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[iso123,ISO 123:1066 (all parts)]]] _Standard_ * [[[iso124,(1)ISO 123:1066 (all parts)]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Standard ISO 123:1066 (all parts) 123 1066 ISO all Standard [1] ISO 123:1066 (all parts) 123 1066 ISO all OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes BSI reference with year" do VCR.use_cassette("bsi16341", match_requests_on: %i[method uri body]) do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso124,BSI BS EN ISO 19011:2018]]] _Standard_ * [[[iso123,BSI BS EN 16341]]] _Standard_ * [[[ref_2,BSI BS EN ISO 14044:2006+A2:2020]]], _Environmental management – Life cycle assessment – Requirements and guidelines_ INPUT output = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS)) .xpath("//xmlns:docidentifier[@type = 'BSI']").map(&:text) expect(output).to include("BS EN ISO 14044:2006+A2:2020") expect(output).to include("BS EN 16341:2012") expect(output).to include("BS EN 16341") expect(output).not_to include("BS EN ISO 19011") expect(output).to include("BS EN ISO 19011:2018") end end it "processes RFC reference in Normative References" do VCR.use_cassette "rfcbib_get_rfc8341" do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso123,IETF(RFC 8341)]]], _Standard_ * [[[iso124,(1)IETF(RFC 8341)]]], _Standard_ == Clause 4 <> INPUT output = <<~OUTPUT #{BLANK_HDR} Clause 4

Normative references #{NORM_REF_BOILERPLATE} Network Configuration Access Control Model https://www.rfc-editor.org/info/rfc8341 RFC 8341 RFC8341 10.17487/RFC8341 RFC8341 2018-03 A. Bierman M. Bjorklund en

The standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) or the RESTCONF protocol requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability. There is a need for standard mechanisms to restrict NETCONF or RESTCONF protocol access for particular users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content. This document defines such an access control model.

This document obsoletes RFC 6536.

STD 91 RFC 8341 NETCONF RESTCONF YANG XML
Network Configuration Access Control Model https://www.rfc-editor.org/info/rfc8341 RFC 8341 [1] RFC8341 10.17487/RFC8341 RFC8341 2018-03 A. Bierman M. Bjorklund en

The standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) or the RESTCONF protocol requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability. There is a need for standard mechanisms to restrict NETCONF or RESTCONF protocol access for particular users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content. This document defines such an access control model.

This document obsoletes RFC 6536.

STD 91 RFC 8341 NETCONF RESTCONF YANG XML
OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end end it "processes non-ISO reference in Normative References" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[iso123,XYZ 123:1966 (all parts)]]] _Standard_ * [[[iso124,(1)XYZ 123:1966]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Normative references #{NORM_REF_BOILERPLATE} Standard XYZ 123:1966 (all parts) 123:1966 (all parts) 1966 Standard [1] XYZ 123:1966 123 1966 OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes non-ISO reference in Bibliography" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} [bibliography] == Bibliography * [[[iso123,2]]] _Standard_ * [[[iso124,(B)]]] _Standard_ * [[[iso125,1]]] _Standard_ * [[[iso126,(A1)]]] _Standard_ * [[[iso127,(4)XYZ 123:1066 (all parts)]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Bibliography Standard [1] Standard [B] Standard [3] Standard [A1] Standard [5] XYZ 123:1066 (all parts) 123:1066 (all parts) OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "process ISO reference without an Internet connection" do expect(RelatonIso::IsoBibliography).to receive(:search).with("ISO 123") do raise RelatonBib::RequestError.new "getaddrinfo" end.at_least :once input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[iso123,ISO 123]]] _Standard_ * [[[iso124,(1)ISO 123]]] _Standard_ INPUT output = <<~OUTPUT Document title en published #{Date.today.year} standard Normative references #{NORM_REF_BOILERPLATE} Standard ISO 123 123 ISO Standard [1] ISO 123 123 ISO OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes repository reference" do input = <<~INPUT #{ISOBIB_BLANK_HDR} == Scope <> <> <> <> [bibliography] == Normative References * [[[iso123,repo:(ab/ISO 123)]]] _Standard_ * [[[iso124,repo:(ab/ISO 124,id)]]] _Standard_ * [[[iso125,dropid(repo:(ab/ISO 124,id))]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Scope

1 1

Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

Standard ISO 123 ab/ISO 123 123 Standard id ab/ISO 124 Standard id ab/ISO 124
OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes hyperlink reference, ingest RXL or XML if available" do input = <<~INPUT #{ISOBIB_BLANK_HDR} == Scope <> <> <> <> [bibliography] == Normative References * [[[iso123,path:(spec/assets/iso123,ISO 123)]]] _Standard_ * [[[iso124,path:(a/b.adoc,ISO 124)]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Scope

1

xyz

1 xyz

Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

Rubber latex Sampling Rubber latex – Sampling Latex de caoutchouc Échantillonnage Latex de caoutchouc – Échantillonnage https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss spec/assets/iso123 ISO 123 (all parts) 123 2001 International Organization for Standardization ISO www.iso.org 3 en fr 90 93 2001 ISO ISO 123:1985 Rubber latex Sampling Rubber latex – Sampling Latex de caoutchouc Échantillonnage Latex de caoutchouc – Échantillonnage https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123:2001 123 2001 International Organization for Standardization ISO www.iso.org 3 en fr 90 93 2001 ISO ISO 123:1985 Geneva ISO 123:1985 ISO 123:1974 Geneva Standard a/b a/b ISO 124 124
OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "overrides normative status of bibliographies" do #mock_isobib_get_123_no_docid(1) #mock_isobib_get_123_no_docid_lbl(1) VCR.use_cassette "isobib_get_123_2" do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography,normative=false] == Normative References * [[[iso123,ISO 123]]] _Standard_ [bibliography,normative=true] == Bibliography * [[[iso124,(1)ISO 123]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Bibliography Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123 urn:iso:std:iso:123:stage-90.93:ed-3 123 International Organization for Standardization ISO www.iso.org 3 en 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123:2001 urn:iso:std:iso:123:stage-90.93:ed-3 123 2001-05 International Organization for Standardization ISO www.iso.org 3 en This International Standard specifies procedures for sampling natural rubber latex concentrate and for sampling synthetic rubber latices and artificial latices. It is also suitable for sampling rubber latex contained in drums, tank cars or tanks. The procedures may also be used for sampling plastics dispersions. 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Geneva Geneva Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123 [1] urn:iso:std:iso:123:stage-90.93:ed-3 123 International Organization for Standardization ISO www.iso.org 3 en 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Rubber latex Sampling Rubber latex — Sampling https://www.iso.org/standard/23281.html https://www.iso.org/obp/ui/#!iso:std:23281:en https://www.iso.org/contents/data/standard/02/32/23281.detail.rss ISO 123:2001 urn:iso:std:iso:123:stage-90.93:ed-3 123 2001-05 International Organization for Standardization ISO www.iso.org 3 en This International Standard specifies procedures for sampling natural rubber latex concentrate and for sampling synthetic rubber latices and artificial latices. It is also suitable for sampling rubber latex contained in drums, tank cars or tanks. The procedures may also be used for sampling plastics dispersions. 90 93 2001 ISO ISO 123:1985 ISO 123:1985 Geneva Geneva
OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end end it "processes formatting within bibliographic references" do VCR.use_cassette "isobib_get_123_1" do input = <<~INPUT #{ISOBIB_BLANK_HDR} [bibliography] == Normative References * [[[reference,ISO 123]]] _Standard_ == Section <> <> <> <> <> INPUT output = <<~OUTPUT #{BLANK_HDR} Section

reference reference A x2 A

B

3.4.2ISO 9000:2005

Superseded by ISO 9000:2015.

OUTPUT a = Nokogiri::XML(Asciidoctor.convert(input, *OPTIONS)) a.at("//xmlns:bibliography").remove expect((strip_guid(a.to_xml))).to be_equivalent_to(output) end end it "have formatted reference tag" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} <> [bibliography] == Bibliography * [[[iso124,(*A*.footnote:[hello])XYZ]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Foreword

Bibliography Standard [ A .

hello

]
XYZ
OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end it "processes combinations of crossreferences" do input = <<~INPUT #{ASCIIDOC_BLANK_HDR} == Section <> <> <> <> <> <> <> [bibliography] == Bibliography * [[[ref1,XYZ]]] _Standard_ INPUT output = <<~OUTPUT #{BLANK_HDR} Section

3 5 3 5 3 5 text 3 5 3 5 3 5 text 3 5 8 10

Bibliography Standard XYZ OUTPUT expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS)))) .to be_equivalent_to xmlpp(output) end private def mock_isobib_get_123_no_docid(times) expect(RelatonIso::IsoBibliography).to receive(:get) .with("ISO 123", nil, { code: "ISO 123", lang: "en", match: anything, process: 1, ord: anything, title: "Standard", usrlbl: nil, year: nil }) do RelatonBib::XMLParser.from_xml(<<~"OUTPUT") \n https://www.iso.org/standard/23281.html\n https://www.iso.org/obp/ui/#!iso:std:23281:en\n https://www.iso.org/contents/data/standard/02/32/23281.detail.rss\n \n 2001\n \n \n \n \n International Organization for Standardization\n ISO\n www.iso.org\n \n \n 3\n en\n fr\n \n Published\n \n 2001\n \n \n ISO\n \n \n \n \n \n \n ISO 123:1985\n \n \n \n \n ISO 123:2001\n \n \n OUTPUT end.exactly(times).times end def mock_isobib_get_123_no_docid_lbl(times) expect(RelatonIso::IsoBibliography).to receive(:get) .with("ISO 123", nil, { code: "ISO 123", lang: "en", match: anything, process: 1, ord: anything, title: "Standard", usrlbl: "(1)", year: nil }) do RelatonBib::XMLParser.from_xml(<<~"OUTPUT") \n https://www.iso.org/standard/23281.html\n https://www.iso.org/obp/ui/#!iso:std:23281:en\n https://www.iso.org/contents/data/standard/02/32/23281.detail.rss\n \n 2001\n \n \n \n \n International Organization for Standardization\n ISO\n www.iso.org\n \n \n 3\n en\n fr\n \n Published\n \n 2001\n \n \n ISO\n \n \n \n \n \n \n ISO 123:1985\n \n \n \n \n ISO 123:2001\n \n \n OUTPUT end.exactly(times).times end def mock_rfcbib_get_rfc8342(times) expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 8342", nil, anything) do RelatonBib::XMLParser.from_xml(<<~"OUTPUT") Network Configuration Access Control Model 10.17487/RFC8341 ISO 8341 ISO 8342-EN ISO 8342-FR ISO 8342-DE 2018 published OUTPUT end.exactly(times).times end def mock_rfcbib_get_rfc8343(times) expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 8343", nil, anything) do RelatonBib::XMLParser.from_xml(<<~"OUTPUT") Network Configuration Access Control Model 10.17487/RFC8341 ISO 8341 ISO 8343-EN ISO 8343-FR ISO 8343-DE 2018 published OUTPUT end.exactly(times).times end end