require "spec_helper" require "relaton_iso" require "relaton_ietf" RSpec.describe Asciidoctor::ISO do it "processes draft ISO reference" do mock_fdis expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ISOBIB_BLANK_HDR} == Clause <> <> A.footnote:[a footnote] <> <> [bibliography] == Normative References * [[[iso123,ISO 123:--]]] footnote:[The standard is in press] _Standard_ * [[[fdis,ISO/FDIS 17664-1]]] Title INPUT #{BLANK_HDR} Clause

The standard is in press A.

a footnote

Under preparation. (Stage at the time of publication ISO/FDIS 17664-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:— 123 International Organization for Standardization ISO The standard is in press #{Date.today} Traitement de produits de soins de santé Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif Partie 1: Titre manque Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque https://www.iso.org/standard/81720.html https://www.iso.org/contents/data/standard/08/17/81720.detail.rss ISO/FDIS 17664-1 urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr 17664 International Organization for Standardization ISO www.iso.org 1

Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).

en fr 50 00 unknown ISO/FDIS ISO 17664:2017 2020-11-03 Traitement de produits de soins de santé Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif Partie 1: Titre manque Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque https://www.iso.org/standard/81720.html https://www.iso.org/contents/data/standard/08/17/81720.detail.rss ISO/FDIS 17664-1 urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr 17664 International Organization for Standardization ISO www.iso.org 1

Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).

en fr 50 00 unknown ISO/FDIS ISO 17664:2017 Geneva
Geneva
OUTPUT end it "processes all-parts ISO reference" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} == Clause <> [bibliography] == Normative References * [[[iso123,ISO 123:1066 (all parts)]]] _Standard_ INPUT #{BLANK_HDR} Clause

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:1066 (all parts) 123 1066 International Organization for Standardization ISO all
OUTPUT end it "processes non-ISO reference in Normative References" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [bibliography] == Normative References * [[[iso123,XYZ 123:1066 (all parts)]]] _Standard_ INPUT #{BLANK_HDR} 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 XYZ 123:1066 (all parts) 123:1066 (all parts)
OUTPUT end it "processes non-ISO reference in Bibliography" do expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT") #{ASCIIDOC_BLANK_HDR} [bibliography] == Bibliography * [[[iso123,1]]] _Standard_ INPUT #{BLANK_HDR} Bibliography Standard [1] OUTPUT end private def mock_fdis expect(RelatonIso::IsoBibliography).to receive(:get) .with("ISO/FDIS 17664-1", nil, lang: "en", title: "Title", usrlbl: nil) do RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT") #{Date.today} Traitement de produits de soins de santé Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif Partie 1: Titre manque Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque https://www.iso.org/standard/81720.html https://www.iso.org/contents/data/standard/08/17/81720.detail.rss ISO/FDIS 17664-1 urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr 17664 International Organization for Standardization ISO www.iso.org 1 en fr 50 00 unknown ISO/FDIS ISO 17664:2017 2020-11-03 Traitement de produits de soins de santé Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif Partie 1: Titre manque Traitement de produits de soins de santé — Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif — Partie 1: Titre manque https://www.iso.org/standard/81720.html https://www.iso.org/contents/data/standard/08/17/81720.detail.rss ISO/FDIS 17664-1 urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr 17664 International Organization for Standardization ISO www.iso.org 1 en fr 50 00 unknown ISO/FDIS ISO 17664:2017 Geneva Geneva OUTPUT end end end