metanorma-iso 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +0 -4
  3. data/lib/asciidoctor/iso/base.rb +12 -12
  4. data/lib/asciidoctor/iso/cleanup.rb +1 -1
  5. data/lib/asciidoctor/iso/isodoc.rng +19 -1
  6. data/lib/asciidoctor/iso/isostandard-amd.rng +3 -0
  7. data/lib/asciidoctor/iso/isostandard.rng +6 -0
  8. data/lib/metanorma/iso/version.rb +1 -1
  9. data/spec/asciidoctor-iso/amd_spec.rb +575 -573
  10. data/spec/asciidoctor-iso/base_spec.rb +445 -454
  11. data/spec/asciidoctor-iso/blocks_spec.rb +333 -288
  12. data/spec/asciidoctor-iso/cleanup_spec.rb +813 -704
  13. data/spec/asciidoctor-iso/inline_spec.rb +116 -91
  14. data/spec/asciidoctor-iso/lists_spec.rb +128 -121
  15. data/spec/asciidoctor-iso/refs_spec.rb +308 -250
  16. data/spec/asciidoctor-iso/section_spec.rb +273 -242
  17. data/spec/asciidoctor-iso/table_spec.rb +258 -242
  18. data/spec/asciidoctor-iso/validate_spec.rb +1099 -1165
  19. data/spec/isodoc/amd_spec.rb +967 -946
  20. data/spec/isodoc/blocks_spec.rb +530 -507
  21. data/spec/isodoc/i18n_spec.rb +953 -911
  22. data/spec/isodoc/inline_spec.rb +355 -293
  23. data/spec/isodoc/iso_spec.rb +338 -314
  24. data/spec/isodoc/metadata_spec.rb +392 -382
  25. data/spec/isodoc/postproc_spec.rb +833 -656
  26. data/spec/isodoc/ref_spec.rb +374 -331
  27. data/spec/isodoc/section_spec.rb +608 -525
  28. data/spec/isodoc/table_spec.rb +472 -411
  29. data/spec/isodoc/terms_spec.rb +209 -185
  30. data/spec/isodoc/xref_spec.rb +1370 -1236
  31. data/spec/metanorma/processor_spec.rb +28 -26
  32. data/spec/spec_helper.rb +176 -193
  33. metadata +2 -4
  34. data/.rubocop.ribose.yml +0 -66
  35. data/spec/assets/xref_error.adoc +0 -7
@@ -5,8 +5,7 @@ require "relaton_ietf"
5
5
  RSpec.describe Asciidoctor::ISO do
6
6
  it "processes draft ISO reference" do
7
7
  mock_fdis
8
- #mock_isobib_get_123
9
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
8
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
10
9
  #{ISOBIB_BLANK_HDR}
11
10
  == Clause
12
11
  <<iso123>>
@@ -21,168 +20,159 @@ RSpec.describe Asciidoctor::ISO do
21
20
  * [[[iso123,ISO 123:--]]] footnote:[The standard is in press] _Standard_
22
21
  * [[[fdis,ISO/FDIS 17664-1]]] Title
23
22
  INPUT
24
- #{BLANK_HDR}
25
- <sections>
26
- <clause id='_' inline-header='false' obligation='normative'>
27
- <title>Clause</title>
28
- <p id='_'>
29
- <eref type='inline' bibitemid='iso123' citeas='ISO 123:--'/>
30
- <fn reference='1'>The standard is in press</fn>
31
- <eref type='inline' bibitemid='iso123' citeas='ISO 123:--'/>
32
- A.
33
- <fn reference='2'>
34
- <p id='_'>a footnote</p>
35
- </fn>
36
- <eref type='inline' bibitemid='fdis' citeas='ISO/FDIS 17664-1'/>
37
- <fn reference='3'>
38
- <p id='_'>Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
39
- </fn>
40
- <eref type='inline' bibitemid='fdis' citeas='ISO/FDIS 17664-1'/>
41
- </p>
42
- </clause>
43
- </sections>
44
- <bibliography>
45
- <references id='_' normative='true' obligation='informative'>
46
- <title>Normative references</title>
47
- <p id='_'>
48
- The following documents are referred to in the text in such a way that
49
- some or all of their content constitutes requirements of this document.
50
- For dated references, only the edition cited applies. For undated
51
- references, the latest edition of the referenced document (including any
52
- amendments) applies.
53
- </p>
54
- <bibitem id='iso123' type='standard'>
55
- <title format='text/plain'>Standard</title>
56
- <docidentifier type='ISO'>ISO 123:—</docidentifier>
57
- <docnumber>123</docnumber>
58
- <date type='published'>
59
- <on>–</on>
60
- </date>
61
- <contributor>
62
- <role type='publisher'/>
63
- <organization>
64
- <name>International Organization for Standardization</name>
65
- <abbreviation>ISO</abbreviation>
66
- </organization>
67
- </contributor>
68
- <note format='text/plain' type='Unpublished-Status'>The standard is in press</note>
69
- </bibitem>
70
- <bibitem id='fdis' type='standard'>
71
- <fetched>#{Date.today}</fetched>
72
- <title type='title-intro' format='text/plain' language='fr' script='Latn'>Traitement de produits de soins de santé</title>
73
- <title type='title-main' format='text/plain' language='fr' script='Latn'>
74
- Informations relatives au traitement des dispositifs médicaux à
75
- fournir par le fabricant du dispositif
76
- </title>
77
- <title type='title-part' format='text/plain' language='fr' script='Latn'>Partie 1: Titre manque</title>
78
- <title type='main' format='text/plain' language='fr' script='Latn'>
79
- Traitement de produits de soins de santé — Informations relatives au
80
- traitement des dispositifs médicaux à fournir par le fabricant du
81
- dispositif — Partie 1: Titre manque
82
- </title>
83
- <uri type='src'>https://www.iso.org/standard/81720.html</uri>
84
- <uri type='rss'>https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
85
- <docidentifier type='ISO'>ISO/FDIS 17664-1</docidentifier>
86
- <docidentifier type='URN'>urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
87
- <docnumber>17664</docnumber>
88
- <contributor>
89
- <role type='publisher'/>
90
- <organization>
91
- <name>International Organization for Standardization</name>
92
- <abbreviation>ISO</abbreviation>
93
- <uri>www.iso.org</uri>
94
- </organization>
95
- </contributor>
96
- <edition>1</edition>
97
- <note type='Unpublished-Status'>
98
- <p id='_'>Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
99
- </note>
100
- <language>en</language>
101
- <language>fr</language>
102
- <script>Latn</script>
103
- <status>
104
- <stage>50</stage>
105
- <substage>00</substage>
106
- </status>
107
- <copyright>
108
- <from>unknown</from>
109
- <owner>
110
- <organization>
111
- <name>ISO/FDIS</name>
112
- </organization>
113
- </owner>
114
- </copyright>
115
- <relation type='obsoletes'>
116
- <bibitem type='standard'>
117
- <formattedref format='text/plain'>ISO 17664:2017</formattedref>
118
- </bibitem>
119
- </relation>
120
- <relation type='instance'>
121
- <bibitem type='standard'>
122
- <fetched>2020-11-03</fetched>
123
- <title type='title-intro' format='text/plain' language='fr' script='Latn'>Traitement de produits de soins de santé</title>
124
- <title type='title-main' format='text/plain' language='fr' script='Latn'>
125
- Informations relatives au traitement des dispositifs médicaux à
126
- fournir par le fabricant du dispositif
127
- </title>
128
- <title type='title-part' format='text/plain' language='fr' script='Latn'>Partie 1: Titre manque</title>
129
- <title type='main' format='text/plain' language='fr' script='Latn'>
130
- Traitement de produits de soins de santé — Informations relatives
131
- au traitement des dispositifs médicaux à fournir par le fabricant
132
- du dispositif — Partie 1: Titre manque
133
- </title>
134
- <uri type='src'>https://www.iso.org/standard/81720.html</uri>
135
- <uri type='rss'>https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
136
- <docidentifier type='ISO'>ISO/FDIS 17664-1</docidentifier>
137
- <docidentifier type='URN'>urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
138
- <docnumber>17664</docnumber>
139
- <contributor>
140
- <role type='publisher'/>
141
- <organization>
142
- <name>International Organization for Standardization</name>
143
- <abbreviation>ISO</abbreviation>
144
- <uri>www.iso.org</uri>
145
- </organization>
146
- </contributor>
147
- <edition>1</edition>
148
- <note type='Unpublished-Status'>
149
- <p id='_'>Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
150
- </note>
151
- <language>en</language>
152
- <language>fr</language>
153
- <script>Latn</script>
154
- <status>
155
- <stage>50</stage>
156
- <substage>00</substage>
157
- </status>
158
- <copyright>
159
- <from>unknown</from>
160
- <owner>
161
- <organization>
162
- <name>ISO/FDIS</name>
163
- </organization>
164
- </owner>
165
- </copyright>
166
- <relation type='obsoletes'>
167
- <bibitem type='standard'>
168
- <formattedref format='text/plain'>ISO 17664:2017</formattedref>
169
- </bibitem>
170
- </relation>
171
- <place>Geneva</place>
172
- </bibitem>
173
- </relation>
174
- <place>Geneva</place>
175
- </bibitem>
176
- </references>
177
- </bibliography>
178
- </iso-standard>
23
+ #{BLANK_HDR}
24
+ <sections>
25
+ <clause id="_" inline-header="false" obligation="normative">
26
+ <title>Clause</title>
27
+ <p id="_">
28
+ <eref bibitemid="iso123" citeas="ISO 123:--" type="inline"/>
29
+ <fn reference="1">The standard is in press</fn>
30
+ <eref bibitemid="iso123" citeas="ISO 123:--" type="inline"/>A.
31
+ <fn reference="2">
32
+ <p id="_">a footnote</p></fn>
33
+ <eref bibitemid="fdis" citeas="ISO/FDIS 17664-1" type="inline"/>
34
+ <fn reference="3">
35
+ <p id="_">Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
36
+ </fn>
37
+ <eref bibitemid="fdis" citeas="ISO/FDIS 17664-1" type="inline"/>
38
+ </p>
39
+ </clause>
40
+ </sections>
41
+ <bibliography>
42
+ <references id="_" normative="true" obligation="informative">
43
+ <title>Normative references</title>
44
+ <p id="_">The following documents are referred to in the text in such a way that
45
+ some or all of their content constitutes requirements of this document.
46
+ For dated references, only the edition cited applies. For undated
47
+ references, the latest edition of the referenced document (including any
48
+ amendments) applies.
49
+ </p>
50
+ <bibitem id="iso123" type="standard">
51
+ <title format="text/plain">Standard</title>
52
+ <docidentifier type="ISO">ISO 123:—</docidentifier>
53
+ <docnumber>123</docnumber>
54
+ <date type="published">
55
+ <on>–</on>
56
+ </date>
57
+ <contributor>
58
+ <role type="publisher"/>
59
+ <organization>
60
+ <name>International Organization for Standardization</name>
61
+ <abbreviation>ISO</abbreviation>
62
+ </organization>
63
+ </contributor>
64
+ <note format="text/plain" type="Unpublished-Status">The standard is in press</note>
65
+ </bibitem>
66
+ <bibitem id="fdis" type="standard">
67
+ <fetched>#{Date.today}</fetched>
68
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
69
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à
70
+ fournir par le fabricant du dispositif
71
+ </title>
72
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
73
+ <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives au
74
+ traitement des dispositifs médicaux à fournir par le fabricant du
75
+ dispositif — Partie 1: Titre manque
76
+ </title>
77
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
78
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
79
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
80
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
81
+ <docnumber>17664</docnumber>
82
+ <contributor>
83
+ <role type="publisher"/>
84
+ <organization>
85
+ <name>International Organization for Standardization</name>
86
+ <abbreviation>ISO</abbreviation>
87
+ <uri>www.iso.org</uri>
88
+ </organization>
89
+ </contributor>
90
+ <edition>1</edition>
91
+ <note type="Unpublished-Status">
92
+ <p id="_">Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
93
+ </note>
94
+ <language>en</language>
95
+ <language>fr</language>
96
+ <script>Latn</script>
97
+ <status>
98
+ <stage>50</stage>
99
+ <substage>00</substage>
100
+ </status>
101
+ <copyright>
102
+ <from>unknown</from>
103
+ <owner>
104
+ <organization>
105
+ <name>ISO/FDIS</name>
106
+ </organization>
107
+ </owner>
108
+ </copyright>
109
+ <relation type="obsoletes">
110
+ <bibitem type="standard">
111
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
112
+ </bibitem>
113
+ </relation>
114
+ <relation type="instance">
115
+ <bibitem type="standard">
116
+ <fetched>2020-11-03</fetched>
117
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
118
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à
119
+ fournir par le fabricant du dispositif
120
+ </title>
121
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
122
+ <title format="text/plain" language="fr" script="Latn" type="main">Traitement de produits de soins de santé — Informations relatives
123
+ au traitement des dispositifs médicaux à fournir par le fabricant
124
+ du dispositif — Partie 1: Titre manque
125
+ </title>
126
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
127
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
128
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
129
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
130
+ <docnumber>17664</docnumber>
131
+ <contributor>
132
+ <role type="publisher"/>
133
+ <organization>
134
+ <name>International Organization for Standardization</name>
135
+ <abbreviation>ISO</abbreviation>
136
+ <uri>www.iso.org</uri>
137
+ </organization>
138
+ </contributor>
139
+ <edition>1</edition>
140
+ <note type="Unpublished-Status">
141
+ <p id="_">Under preparation. (Stage at the time of publication ISO/FDIS 17664-1).</p>
142
+ </note>
143
+ <language>en</language>
144
+ <language>fr</language>
145
+ <script>Latn</script>
146
+ <status>
147
+ <stage>50</stage>
148
+ <substage>00</substage>
149
+ </status>
150
+ <copyright>
151
+ <from>unknown</from>
152
+ <owner>
153
+ <organization>
154
+ <name>ISO/FDIS</name>
155
+ </organization>
156
+ </owner>
157
+ </copyright>
158
+ <relation type="obsoletes">
159
+ <bibitem type="standard">
160
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
161
+ </bibitem>
162
+ </relation>
163
+ <place>Geneva</place>
164
+ </bibitem>
165
+ </relation>
166
+ <place>Geneva</place>
167
+ </bibitem>
168
+ </references>
169
+ </bibliography>
170
+ </iso-standard>
179
171
  OUTPUT
180
172
  end
181
173
 
182
174
  it "processes all-parts ISO reference" do
183
- #stub_fetch_ref(all_parts: true)
184
-
185
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
175
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
186
176
  #{ASCIIDOC_BLANK_HDR}
187
177
 
188
178
  == Clause
@@ -195,123 +185,191 @@ RSpec.describe Asciidoctor::ISO do
195
185
  * [[[iso123,ISO 123:1066 (all parts)]]] _Standard_
196
186
  INPUT
197
187
  #{BLANK_HDR}
198
- <sections>
199
- <clause id='_' inline-header='false' obligation='normative'>
200
- <title>Clause</title>
201
- <p id='_'>
202
- <eref type='inline' bibitemid='iso123' citeas='ISO 123:1066'/>
203
- </p>
204
- </clause>
205
- </sections>
206
- <bibliography><references id="_" obligation="informative" normative="true">
207
- <title>Normative references</title>
208
- <p id="_">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.</p>
209
- <bibitem id="iso123" type="standard">
210
- <title format="text/plain">Standard</title>
211
- <docidentifier>ISO 123:1066 (all parts)</docidentifier>
212
- <docnumber>123</docnumber>
213
- <date type="published">
214
- <on>1066</on>
215
- </date>
216
- <contributor>
217
- <role type="publisher"/>
218
- <organization>
219
- <name>International Organization for Standardization</name>
220
- <abbreviation>ISO</abbreviation>
221
- </organization>
222
- </contributor>
223
- <extent type="part"><referenceFrom>all</referenceFrom></extent>
224
- </bibitem>
225
- </references>
226
- </bibliography>
188
+ <sections>
189
+ <clause id="_" inline-header="false" obligation="normative">
190
+ <title>Clause</title>
191
+ <p id="_">
192
+ <eref bibitemid="iso123" citeas="ISO 123:1066" type="inline"/>
193
+ </p>
194
+ </clause>
195
+ </sections>
196
+ <bibliography>
197
+ <references id="_" normative="true" obligation="informative">
198
+ <title>Normative references</title>
199
+ <p id="_">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.</p>
200
+ <bibitem id="iso123" type="standard">
201
+ <title format="text/plain">Standard</title>
202
+ <docidentifier>ISO 123:1066 (all parts)</docidentifier>
203
+ <docnumber>123</docnumber>
204
+ <date type="published">
205
+ <on>1066</on>
206
+ </date>
207
+ <contributor>
208
+ <role type="publisher"/>
209
+ <organization>
210
+ <name>International Organization for Standardization</name>
211
+ <abbreviation>ISO</abbreviation>
212
+ </organization>
213
+ </contributor>
214
+ <extent type="part">
215
+ <referenceFrom>all</referenceFrom>
216
+ </extent>
217
+ </bibitem>
218
+ </references>
219
+ </bibliography>
227
220
  </iso-standard>
228
221
  OUTPUT
229
222
  end
230
223
 
231
224
  it "processes non-ISO reference in Normative References" do
232
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
225
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
233
226
  #{ASCIIDOC_BLANK_HDR}
234
227
  [bibliography]
235
228
  == Normative References
236
229
 
237
230
  * [[[iso123,XYZ 123:1066 (all parts)]]] _Standard_
238
231
  INPUT
239
- #{BLANK_HDR}
240
- <sections>
232
+ #{BLANK_HDR}
233
+ <sections>
241
234
 
242
- </sections><bibliography><references id="_" obligation="informative" normative="true">
243
- <title>Normative references</title>
244
- <p id="_">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.</p>
245
- <bibitem id="iso123">
246
- <formattedref format="application/x-isodoc+xml">
247
- <em>Standard</em>
248
- </formattedref>
249
- <docidentifier>XYZ 123:1066 (all parts)</docidentifier>
250
- <docnumber>123:1066 (all parts)</docnumber>
251
- </bibitem>
252
- </references>
253
- </bibliography>
254
- </iso-standard>
235
+ </sections>
236
+ <bibliography>
237
+ <references id="_" normative="true" obligation="informative">
238
+ <title>Normative references</title>
239
+ <p id="_">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.</p>
240
+ <bibitem id="iso123">
241
+ <formattedref format="application/x-isodoc+xml">
242
+ <em>Standard</em>
243
+ </formattedref>
244
+ <docidentifier>XYZ 123:1066 (all parts)</docidentifier>
245
+ <docnumber>123:1066 (all parts)</docnumber>
246
+ </bibitem>
247
+ </references>
248
+ </bibliography>
249
+ </iso-standard>
255
250
  OUTPUT
256
251
  end
257
252
 
258
253
  it "processes non-ISO reference in Bibliography" do
259
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iso, header_footer: true, agree_to_terms: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
254
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
260
255
  #{ASCIIDOC_BLANK_HDR}
261
256
  [bibliography]
262
257
  == Bibliography
263
258
 
264
259
  * [[[iso123,1]]] _Standard_
265
260
  INPUT
266
- #{BLANK_HDR}
267
- <sections>
261
+ #{BLANK_HDR}
262
+ <sections>
268
263
 
269
- </sections><bibliography><references id="_" obligation="informative" normative="false">
270
- <title>Bibliography</title>
271
- <bibitem id="iso123">
272
- <formattedref format="application/x-isodoc+xml">
273
- <em>Standard</em>
274
- </formattedref>
275
- <docidentifier type="metanorma">[1]</docidentifier>
276
- </bibitem>
277
- </references>
278
- </bibliography>
279
- </iso-standard>
264
+ </sections>
265
+ <bibliography>
266
+ <references id="_" normative="false" obligation="informative">
267
+ <title>Bibliography</title>
268
+ <bibitem id="iso123">
269
+ <formattedref format="application/x-isodoc+xml">
270
+ <em>Standard</em>
271
+ </formattedref>
272
+ <docidentifier type="metanorma">[1]</docidentifier>
273
+ </bibitem>
274
+ </references>
275
+ </bibliography>
276
+ </iso-standard>
280
277
  OUTPUT
281
278
  end
282
279
 
283
- private
280
+ private
284
281
 
285
- def mock_isobib_get_123
286
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO 123", nil, {:lang=>"en", :title=>"Title", :usrlbl=>nil}) do
287
- RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
288
- <bibitem type=\"international-standard\" id=\"ISO123\">\n <fetched>#{Date.today}</fetched>\n<title format=\"text/plain\" language=\"en\" script=\"Latn\">Rubber latex -- Sampling</title>\n <title format=\"text/plain\" language=\"fr\" script=\"Latn\">Latex de caoutchouc -- ?chantillonnage</title>\n <uri type=\"src\">https://www.iso.org/standard/23281.html</uri>\n <uri type=\"obp\">https://www.iso.org/obp/ui/#!iso:std:23281:en</uri>\n <uri type=\"rss\">https://www.iso.org/contents/data/standard/02/32/23281.detail.rss</uri>\n <docidentifier type="ISO">ISO 123:2001</docidentifier>\n <date type=\"published\">\n <on>2001</on>\n </date>\n <contributor>\n <role type=\"publisher\"/>\n <organization>\n <name>International Organization for Standardization</name>\n <abbreviation>ISO</abbreviation>\n <uri>www.iso.org</uri>\n </organization>\n </contributor>\n <edition>3</edition>\n <language>en</language>\n <language>fr</language>\n <script>Latn</script>\n <status>Published</status>\n <copyright>\n <from>2001</from>\n <owner>\n <organization>\n <name>ISO</name>\n <abbreviation></abbreviation>\n </organization>\n </owner>\n </copyright>\n <relation type=\"obsoletes\">\n <bibitem>\n <formattedref>ISO 123:1985</formattedref>\n </bibitem>\n </relation>\n <relation type=\"updates\">\n <bibitem>\n <formattedref>ISO 123:2001</formattedref>\n </bibitem>\n </relation>\n</bibitem>
282
+ def mock_fdis
283
+ expect(RelatonIso::IsoBibliography).to receive(:get)
284
+ .with("ISO/FDIS 17664-1", nil, lang: "en", title: "Title", usrlbl: nil) do
285
+ RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
286
+ <bibitem id="x" type="standard">
287
+ <fetched>#{Date.today}</fetched>
288
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
289
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
290
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
291
+ <title format="text/plain" language="fr" script="Latn" type="main">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</title>
292
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
293
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
294
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
295
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
296
+ <docnumber>17664</docnumber>
297
+ <contributor>
298
+ <role type="publisher"/>
299
+ <organization>
300
+ <name>International Organization for Standardization</name>
301
+ <abbreviation>ISO</abbreviation>
302
+ <uri>www.iso.org</uri>
303
+ </organization>
304
+ </contributor>
305
+ <edition>1</edition>
306
+ <language>en</language>
307
+ <language>fr</language>
308
+ <script>Latn</script>
309
+ <status>
310
+ <stage>50</stage>
311
+ <substage>00</substage>
312
+ </status>
313
+ <copyright>
314
+ <from>unknown</from>
315
+ <owner>
316
+ <organization>
317
+ <name>ISO/FDIS</name>
318
+ </organization>
319
+ </owner>
320
+ </copyright>
321
+ <relation type="obsoletes">
322
+ <bibitem type="standard">
323
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
324
+ </bibitem>
325
+ </relation>
326
+ <relation type="instance">
327
+ <bibitem type="standard">
328
+ <fetched>2020-11-03</fetched>
329
+ <title format="text/plain" language="fr" script="Latn" type="title-intro">Traitement de produits de soins de santé</title>
330
+ <title format="text/plain" language="fr" script="Latn" type="title-main">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title>
331
+ <title format="text/plain" language="fr" script="Latn" type="title-part">Partie 1: Titre manque</title>
332
+ <title format="text/plain" language="fr" script="Latn" type="main">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</title>
333
+ <uri type="src">https://www.iso.org/standard/81720.html</uri>
334
+ <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri>
335
+ <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier>
336
+ <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier>
337
+ <docnumber>17664</docnumber>
338
+ <contributor>
339
+ <role type="publisher"/>
340
+ <organization>
341
+ <name>International Organization for Standardization</name>
342
+ <abbreviation>ISO</abbreviation>
343
+ <uri>www.iso.org</uri>
344
+ </organization>
345
+ </contributor>
346
+ <edition>1</edition>
347
+ <language>en</language>
348
+ <language>fr</language>
349
+ <script>Latn</script>
350
+ <status>
351
+ <stage>50</stage>
352
+ <substage>00</substage>
353
+ </status>
354
+ <copyright>
355
+ <from>unknown</from>
356
+ <owner>
357
+ <organization>
358
+ <name>ISO/FDIS</name>
359
+ </organization>
360
+ </owner>
361
+ </copyright>
362
+ <relation type="obsoletes">
363
+ <bibitem type="standard">
364
+ <formattedref format="text/plain">ISO 17664:2017</formattedref>
365
+ </bibitem>
366
+ </relation>
367
+ <place>Geneva</place>
368
+ </bibitem>
369
+ </relation>
370
+ <place>Geneva</place>
371
+ </bibitem>
289
372
  OUTPUT
290
373
  end
291
- end
292
-
293
- def mock_rfcbib_get_rfc8341
294
- expect(IETFBib::RfcBibliography).to receive(:get).with("RFC 8341", nil, {}) do
295
- IETFBib::XMLParser.from_xml(<<~"OUTPUT")
296
- <bibitem id="RFC8341">
297
- <fetched>#{Date.today}</fetched>
298
- <title format="text/plain" language="en" script="Latn">Network Configuration Access Control Model</title>
299
- <docidentifier type="IETF">RFC 8341</docidentifier>
300
- <date type="published">
301
- <on>2018</on>
302
- </date>
303
- <status>published</status>
304
- </bibitem>
305
- OUTPUT
306
- end
307
- end
308
-
309
- def mock_fdis
310
- expect(RelatonIso::IsoBibliography).to receive(:get).with("ISO/FDIS 17664-1", nil, {:lang=>"en", :title=>"Title", :usrlbl=>nil}) do
311
- RelatonIsoBib::XMLParser.from_xml(<<~"OUTPUT")
312
- <bibitem id="x" type="standard"> <fetched>#{Date.today}</fetched> <title type="title-intro" format="text/plain" language="fr" script="Latn">Traitement de produits de soins de santé</title> <title type="title-main" format="text/plain" language="fr" script="Latn">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title> <title type="title-part" format="text/plain" language="fr" script="Latn">Partie 1: Titre manque</title> <title type="main" format="text/plain" language="fr" script="Latn">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</title> <uri type="src">https://www.iso.org/standard/81720.html</uri> <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri> <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier> <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier> <docnumber>17664</docnumber> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>1</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status> <stage>50</stage> <substage>00</substage> </status> <copyright> <from>unknown</from> <owner> <organization> <name>ISO/FDIS</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem type="standard"> <formattedref format="text/plain">ISO 17664:2017</formattedref> </bibitem> </relation> <relation type="instance"> <bibitem type="standard"> <fetched>2020-11-03</fetched> <title type="title-intro" format="text/plain" language="fr" script="Latn">Traitement de produits de soins de santé</title> <title type="title-main" format="text/plain" language="fr" script="Latn">Informations relatives au traitement des dispositifs médicaux à fournir par le fabricant du dispositif</title> <title type="title-part" format="text/plain" language="fr" script="Latn">Partie 1: Titre manque</title> <title type="main" format="text/plain" language="fr" script="Latn">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</title> <uri type="src">https://www.iso.org/standard/81720.html</uri> <uri type="rss">https://www.iso.org/contents/data/standard/08/17/81720.detail.rss</uri> <docidentifier type="ISO">ISO/FDIS 17664-1</docidentifier> <docidentifier type="URN">urn:iso:std:iso-fdis:17664:-1:stage-50.00:ed-1:fr</docidentifier> <docnumber>17664</docnumber> <contributor> <role type="publisher"/> <organization> <name>International Organization for Standardization</name> <abbreviation>ISO</abbreviation> <uri>www.iso.org</uri> </organization> </contributor> <edition>1</edition> <language>en</language> <language>fr</language> <script>Latn</script> <status> <stage>50</stage> <substage>00</substage> </status> <copyright> <from>unknown</from> <owner> <organization> <name>ISO/FDIS</name> </organization> </owner> </copyright> <relation type="obsoletes"> <bibitem type="standard"> <formattedref format="text/plain">ISO 17664:2017</formattedref> </bibitem> </relation> <place>Geneva</place> </bibitem> </relation> <place>Geneva</place></bibitem>
313
- OUTPUT
314
- end
315
- end
316
-
374
+ end
317
375
  end