metanorma-iec 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::Iec do
4
4
  it "processes inline_quoted formatting" do
5
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
5
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  _emphasis_
8
8
  *strong*
@@ -41,7 +41,7 @@ RSpec.describe Asciidoctor::Iec do
41
41
  end
42
42
 
43
43
  it "processes breaks" do
44
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
44
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
45
45
  #{ASCIIDOC_BLANK_HDR}
46
46
  Line break +
47
47
  line break
@@ -60,7 +60,7 @@ RSpec.describe Asciidoctor::Iec do
60
60
  end
61
61
 
62
62
  it "processes links" do
63
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
63
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
64
64
  #{ASCIIDOC_BLANK_HDR}
65
65
  mailto:fred@example.com
66
66
  http://example.com[]
@@ -77,7 +77,7 @@ RSpec.describe Asciidoctor::Iec do
77
77
  end
78
78
 
79
79
  it "processes bookmarks" do
80
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
80
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
81
81
  #{ASCIIDOC_BLANK_HDR}
82
82
  Text [[bookmark]] Text
83
83
  INPUT
@@ -90,7 +90,7 @@ RSpec.describe Asciidoctor::Iec do
90
90
  end
91
91
 
92
92
  it "processes crossreferences" do
93
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
93
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
94
94
  #{ASCIIDOC_BLANK_HDR}
95
95
  [[reference]]
96
96
  == Section
@@ -115,7 +115,7 @@ RSpec.describe Asciidoctor::Iec do
115
115
  end
116
116
 
117
117
  it "processes bibliographic anchors" do
118
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
118
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
119
119
  #{ASCIIDOC_BLANK_HDR}
120
120
  [bibliography]
121
121
  == Normative References
@@ -145,7 +145,7 @@ RSpec.describe Asciidoctor::Iec do
145
145
  end
146
146
 
147
147
  it "processes footnotes" do
148
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
148
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
149
149
  #{ASCIIDOC_BLANK_HDR}
150
150
  Hello!footnote:[Footnote text]
151
151
  INPUT
@@ -16,7 +16,7 @@ RSpec.describe Asciidoctor::Iec do
16
16
  List F:: List G
17
17
 
18
18
  INPUT
19
- expect(strip_guid(output)).to be_equivalent_to <<~"OUTPUT"
19
+ expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
20
20
  #{BLANK_HDR}
21
21
  <sections>
22
22
  <ul id="_">
@@ -98,7 +98,7 @@ RSpec.describe Asciidoctor::Iec do
98
98
  Note 3.
99
99
 
100
100
  INPUT
101
- expect(strip_guid(output)).to be_equivalent_to <<~"OUTPUT"
101
+ expect(xmlpp(strip_guid(output))).to be_equivalent_to xmlpp(<<~"OUTPUT")
102
102
  #{BLANK_HDR}
103
103
  <sections><ul id="id">
104
104
  <li>
@@ -165,7 +165,7 @@ RSpec.describe Asciidoctor::Iec do
165
165
  end
166
166
 
167
167
  it "anchors lists and list items" do
168
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
168
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
169
169
  #{ASCIIDOC_BLANK_HDR}
170
170
  [[id1]]
171
171
  * [[id2]] List item
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::Iec do
4
4
  it "processes sections" do
5
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
5
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  .Foreword
8
8
 
@@ -113,7 +113,7 @@ RSpec.describe Asciidoctor::Iec do
113
113
  end
114
114
 
115
115
  it "processes sections with title attributes" do
116
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
116
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
117
117
  #{ASCIIDOC_BLANK_HDR}
118
118
  .Foreword
119
119
 
@@ -194,48 +194,58 @@ RSpec.describe Asciidoctor::Iec do
194
194
  <preferred>Term1</preferred>
195
195
  </term>
196
196
  </terms>
197
- <clause id="_" obligation="normative"><title>Terms and definitions</title><terms id="_" obligation="normative">
198
- <title>Normal Terms</title>
199
- <term id="_">
200
- <preferred>Term2</preferred>
201
- </term>
202
- </clause>
203
- <definitions id="_">
204
- <title>Σύμβολα και Συντομογραφίες</title>
205
- </definitions>
206
- </terms>
207
- <definitions id="_">
208
- <title>Σύμβολα και Συντομογραφίες</title>
209
- </definitions>
210
- <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
211
- <title>Introduction</title>
212
- </clause>
213
- <clause id="_" inline-header="false" obligation="normative">
214
- <title>Clause 4.2</title>
215
- </clause></clause>
216
-
217
- </sections><annex id="_" inline-header="false" obligation="normative">
218
- <title>Annex</title>
219
- <clause id="_" inline-header="false" obligation="normative">
220
- <title>Annex A.1</title>
221
- </clause>
222
- <appendix id="_" inline-header="false" obligation="normative">
223
- <title>Appendx 1</title>
224
- </appendix></annex><bibliography><references id="_" obligation="informative">
225
- <title>Normative References</title><p>There are no normative references in this document.</p>
226
- </references><clause id="_" obligation="informative">
227
- <title>Bibliography</title>
228
- <references id="_" obligation="informative">
229
- <title>Bibliography Subsection</title>
230
- </references>
231
- </clause>
232
- </bibliography>
197
+ <clause id='_' obligation='normative'>
198
+ <title>Terms and definitions</title>
199
+ <terms id='_' obligation='normative'>
200
+ <title>Normal Terms</title>
201
+ <term id='_'>
202
+ <preferred>Term2</preferred>
203
+ </term>
204
+ </terms>
205
+ <definitions id='_'>
206
+ <title>Σύμβολα και Συντομογραφίες</title>
207
+ </definitions>
208
+ </clause>
209
+ <definitions id='_'>
210
+ <title>Σύμβολα και Συντομογραφίες</title>
211
+ </definitions>
212
+ <clause id='_' inline-header='false' obligation='normative'>
213
+ <title>Clause 4</title>
214
+ <clause id='_' inline-header='false' obligation='normative'>
215
+ <title>Introduction</title>
216
+ </clause>
217
+ <clause id='_' inline-header='false' obligation='normative'>
218
+ <title>Clause 4.2</title>
219
+ </clause>
220
+ </clause>
221
+ </sections>
222
+ <annex id='_' inline-header='false' obligation='normative'>
223
+ <title>Annex</title>
224
+ <clause id='_' inline-header='false' obligation='normative'>
225
+ <title>Annex A.1</title>
226
+ </clause>
227
+ <appendix id='_' inline-header='false' obligation='normative'>
228
+ <title>Appendx 1</title>
229
+ </appendix>
230
+ </annex>
231
+ <bibliography>
232
+ <references id='_' obligation='informative'>
233
+ <title>Normative References</title>
234
+ <p>There are no normative references in this document.</p>
235
+ </references>
236
+ <clause id='_' obligation='informative'>
237
+ <title>Bibliography</title>
238
+ <references id='_' obligation='informative'>
239
+ <title>Bibliography Subsection</title>
240
+ </references>
241
+ </clause>
242
+ </bibliography>
233
243
  </iso-standard>
234
244
  OUTPUT
235
245
  end
236
246
 
237
247
  it "processes section obligations" do
238
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
248
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
239
249
  #{ASCIIDOC_BLANK_HDR}
240
250
  [obligation=informative]
241
251
  == Clause 1
@@ -266,7 +276,7 @@ RSpec.describe Asciidoctor::Iec do
266
276
  end
267
277
 
268
278
  it "processes inline headers" do
269
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
279
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
270
280
  #{ASCIIDOC_BLANK_HDR}
271
281
  == Clause 1
272
282
 
@@ -297,7 +307,7 @@ RSpec.describe Asciidoctor::Iec do
297
307
  end
298
308
 
299
309
  it "processes blank headers" do
300
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
310
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
301
311
  #{ASCIIDOC_BLANK_HDR}
302
312
  == Clause 1
303
313
 
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Asciidoctor::Iec do
4
4
  it "processes basic tables" do
5
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
5
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  #{ASCIIDOC_BLANK_HDR}
7
7
  .Table Name
8
8
  |===
@@ -36,7 +36,7 @@ RSpec.describe Asciidoctor::Iec do
36
36
  end
37
37
 
38
38
  it "inserts header rows in a table with a name and no header" do
39
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
39
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
40
40
  #{ASCIIDOC_BLANK_HDR}
41
41
  [headerrows=2]
42
42
  .Table Name
@@ -76,7 +76,7 @@ RSpec.describe Asciidoctor::Iec do
76
76
 
77
77
 
78
78
  it "inserts header rows in a table without a name and no header" do
79
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
79
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
80
80
  #{ASCIIDOC_BLANK_HDR}
81
81
  [headerrows=2]
82
82
  |===
@@ -112,7 +112,7 @@ RSpec.describe Asciidoctor::Iec do
112
112
  end
113
113
 
114
114
  it "processes complex tables" do
115
- expect(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))).to be_equivalent_to <<~"OUTPUT"
115
+ expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
116
116
  #{ASCIIDOC_BLANK_HDR}
117
117
  [cols="<,^,^,^,^",options="header,footer",headerrows=2]
118
118
  .Maximum permissible mass fraction of defects
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "processes English" do
5
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
5
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <bibdata>
8
8
  <language>en</language>
@@ -148,7 +148,7 @@ RSpec.describe IsoDoc do
148
148
  end
149
149
 
150
150
  it "defaults to English" do
151
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
151
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
152
152
  <iso-standard xmlns="http://riboseinc.com/isoxml">
153
153
  <bibdata>
154
154
  <language>tlh</language>
@@ -294,7 +294,7 @@ RSpec.describe IsoDoc do
294
294
  end
295
295
 
296
296
  it "processes French" do
297
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
297
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
298
298
  <iso-standard xmlns="http://riboseinc.com/isoxml">
299
299
  <bibdata>
300
300
  <language>fr</language>
@@ -441,7 +441,7 @@ RSpec.describe IsoDoc do
441
441
  end
442
442
 
443
443
  it "processes Simplified Chinese" do
444
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
444
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
445
445
  <iso-standard xmlns="http://riboseinc.com/isoxml">
446
446
  <bibdata>
447
447
  <language>zh</language>
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe IsoDoc do
4
4
  it "processes inline formatting" do
5
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
5
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
6
6
  <iso-standard xmlns="http://riboseinc.com/isoxml">
7
7
  <preface><foreword>
8
8
  <p>
@@ -32,7 +32,7 @@ RSpec.describe IsoDoc do
32
32
  end
33
33
 
34
34
  it "processes links" do
35
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
35
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
36
36
  <iso-standard xmlns="http://riboseinc.com/isoxml">
37
37
  <preface><foreword>
38
38
  <p>
@@ -64,7 +64,7 @@ RSpec.describe IsoDoc do
64
64
  end
65
65
 
66
66
  it "processes unrecognised markup" do
67
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
67
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
68
68
  <iso-standard xmlns="http://riboseinc.com/isoxml">
69
69
  <preface><foreword>
70
70
  <p>
@@ -90,7 +90,7 @@ RSpec.describe IsoDoc do
90
90
  end
91
91
 
92
92
  it "processes AsciiMath and MathML" do
93
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
93
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true).sub(/<html/, "<html xmlns:m='m'"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
94
94
  <iso-standard xmlns="http://riboseinc.com/isoxml">
95
95
  <preface><foreword>
96
96
  <p>
@@ -102,7 +102,7 @@ RSpec.describe IsoDoc do
102
102
  <sections>
103
103
  </iso-standard>
104
104
  INPUT
105
- #{HTML_HDR}
105
+ #{HTML_HDR.sub(/<html/, "<html xmlns:m='m'")}
106
106
  <div>
107
107
  <h1 class="ForewordTitle">FOREWORD</h1>
108
108
  <div class="boilerplate_legal"/>
@@ -122,7 +122,7 @@ RSpec.describe IsoDoc do
122
122
  end
123
123
 
124
124
  it "overrides AsciiMath delimiters" do
125
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
125
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
126
126
  <iso-standard xmlns="http://riboseinc.com/isoxml">
127
127
  <preface><foreword>
128
128
  <p>
@@ -150,7 +150,7 @@ RSpec.describe IsoDoc do
150
150
  end
151
151
 
152
152
  it "processes eref types" do
153
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
153
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
154
154
  <iso-standard xmlns="http://riboseinc.com/isoxml">
155
155
  <preface><foreword>
156
156
  <p>
@@ -194,7 +194,7 @@ RSpec.describe IsoDoc do
194
194
  end
195
195
 
196
196
  it "processes eref content" do
197
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
197
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
198
198
  <iso-standard xmlns="http://riboseinc.com/isoxml">
199
199
  <preface><foreword>
200
200
  <p>
@@ -87,84 +87,8 @@ RSpec.describe IsoDoc::Iec do
87
87
  expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Arial",sans-serif;]m)
88
88
  end
89
89
 
90
- it "does not include IEV in references" do
91
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
92
- <iso-standard xmlns="http://riboseinc.com/isoxml">
93
- <preface><foreword>
94
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
95
- <eref bibitemid="IEV"/>
96
- <eref bibitemid="ISO20483"/>
97
- </p>
98
- </foreword></preface>
99
- <bibliography><references id="_normative_references" obligation="informative"><title>Normative References</title>
100
- <bibitem type="international-standard" id="IEV">
101
- <title format="text/plain" language="en" script="Latn">Electropedia:
102
- The World's Online Electrotechnical Vocabulary</title>
103
- <uri type="src">http://www.electropedia.org</uri>
104
- <docidentifier>IEV</docidentifier>
105
- <contributor>
106
- <role type="publisher"/>
107
- <organization>
108
- <name>International Electrotechnical Commission</name>
109
- <abbreviation>IEC</abbreviation>
110
- <uri>www.iec.ch</uri>
111
- </organization>
112
- </contributor>
113
- <language>en</language> <language>fr</language>
114
- <script>Latn</script>
115
- <copyright>
116
- <owner>
117
- <organization>
118
- <name>International Electrotechnical Commission</name>
119
- <abbreviation>IEC</abbreviation>
120
- <uri>www.iec.ch</uri>
121
- </organization>
122
- </owner>
123
- </copyright>
124
- <relation type="updates">
125
- <bibitem>
126
- <formattedref>IEC 60050</formattedref>
127
- </bibitem>
128
- </relation>
129
- </bibitem>
130
- <bibitem id="ISO20483" type="standard">
131
- <title format="text/plain">Cereals and pulses</title>
132
- <docidentifier>ISO 20483</docidentifier>
133
- <date type="published"><from>2013</from><to>2014</to></date>
134
- <contributor>
135
- <role type="publisher"/>
136
- <organization>
137
- <name>International Organization for Standardization</name>
138
- </organization>
139
- </contributor>
140
- </bibitem>
141
- </references>
142
- </bibliography>
143
- </iso-standard>
144
- INPUT
145
- #{HTML_HDR}
146
- <div>
147
- <h1 class="ForewordTitle">FOREWORD</h1>
148
- <div class="boilerplate_legal"/>
149
- <p id="_f06fd0d1-a203-4f3d-a515-0bdba0f8d83f">
150
- <a href="#IEV">IEV</a>
151
- <a href="#ISO20483">ISO 20483</a>
152
- </p>
153
- </div>
154
- #{IEC_TITLE}
155
- <div>
156
- <h1>1&#160; Normative references</h1>
157
- <p id="ISO20483" class="NormRef">ISO 20483, <i> Cereals and pulses</i></p>
158
- </div>
159
- </div>
160
- </body>
161
- </html>
162
-
163
- OUTPUT
164
- end
165
-
166
90
  it "processes examples" do
167
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
91
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
168
92
  <iso-standard xmlns="http://riboseinc.com/isoxml">
169
93
  <preface><foreword>
170
94
  <example id="samplecode">
@@ -190,7 +114,7 @@ end
190
114
 
191
115
 
192
116
  it "processes sequences of examples" do
193
- expect(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true)).to be_equivalent_to <<~"OUTPUT"
117
+ expect(xmlpp(IsoDoc::Iec::HtmlConvert.new({}).convert("test", <<~"INPUT", true))).to be_equivalent_to xmlpp(<<~"OUTPUT")
194
118
  <iso-standard xmlns="http://riboseinc.com/isoxml">
195
119
  <preface><foreword>
196
120
  <example id="samplecode">
@@ -221,7 +145,7 @@ end
221
145
  end
222
146
 
223
147
  it "processes examples (Word)" do
224
- expect(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body")).to be_equivalent_to <<~"OUTPUT"
148
+ expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
225
149
  <iso-standard xmlns="http://riboseinc.com/isoxml">
226
150
  <preface><foreword>
227
151
  <example id="samplecode">
@@ -254,13 +178,12 @@ end
254
178
  <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
255
179
  <div class="colophon"/>
256
180
  </body>
257
- </html>
258
181
  OUTPUT
259
182
  end
260
183
 
261
184
 
262
185
  it "processes sequences of examples (Word)" do
263
- expect(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body")).to be_equivalent_to <<~"OUTPUT"
186
+ expect(xmlpp(IsoDoc::Iec::WordConvert.new({}).convert("test", <<~"INPUT", true).sub(/^.*<body/m, "<body").sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to xmlpp(<<~"OUTPUT")
264
187
  <iso-standard xmlns="http://riboseinc.com/isoxml">
265
188
  <preface><foreword>
266
189
  <example id="samplecode">
@@ -299,7 +222,6 @@ end
299
222
  <br clear="all" style="page-break-before:left;mso-break-type:section-break"/>
300
223
  <div class="colophon"/>
301
224
  </body>
302
- </html>
303
225
  OUTPUT
304
226
  end
305
227