asciidoctor-rfc 0.2.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +116 -6
  3. data/asciidoctor-rfc.gemspec +15 -1
  4. data/lib/asciidoctor/rfc/common/base.rb +74 -7
  5. data/lib/asciidoctor/rfc/common/front.rb +1 -1
  6. data/lib/asciidoctor/rfc/v2/base.rb +87 -38
  7. data/lib/asciidoctor/rfc/v2/blocks.rb +29 -2
  8. data/lib/asciidoctor/rfc/v2/converter.rb +0 -1
  9. data/lib/asciidoctor/rfc/v2/inline_anchor.rb +2 -8
  10. data/lib/asciidoctor/rfc/v2/lists.rb +7 -4
  11. data/lib/asciidoctor/rfc/v2/table.rb +1 -1
  12. data/lib/asciidoctor/rfc/v3/base.rb +41 -43
  13. data/lib/asciidoctor/rfc/v3/blocks.rb +29 -2
  14. data/lib/asciidoctor/rfc/v3/converter.rb +0 -2
  15. data/lib/asciidoctor/rfc/v3/inline_anchor.rb +2 -6
  16. data/lib/asciidoctor/rfc/version.rb +1 -1
  17. data/spec/asciidoctor/rfc/v2/comments_spec.rb +7 -3
  18. data/spec/asciidoctor/rfc/v2/date_spec.rb +23 -0
  19. data/spec/asciidoctor/rfc/v2/dlist_spec.rb +107 -9
  20. data/spec/asciidoctor/rfc/v2/image_spec.rb +17 -0
  21. data/spec/asciidoctor/rfc/v2/inline_formatting_spec.rb +12 -0
  22. data/spec/asciidoctor/rfc/v2/listing_spec.rb +22 -0
  23. data/spec/asciidoctor/rfc/v2/literal_spec.rb +22 -2
  24. data/spec/asciidoctor/rfc/v2/preamble_spec.rb +72 -0
  25. data/spec/asciidoctor/rfc/v2/references_spec.rb +3 -1
  26. data/spec/asciidoctor/rfc/v2/table_spec.rb +104 -4
  27. data/spec/asciidoctor/rfc/v2/text_spec.rb +89 -0
  28. data/spec/asciidoctor/rfc/v2/ulist_spec.rb +40 -0
  29. data/spec/asciidoctor/rfc/v3/dlist_spec.rb +103 -1
  30. data/spec/asciidoctor/rfc/v3/image_spec.rb +18 -0
  31. data/spec/asciidoctor/rfc/v3/listing_spec.rb +26 -0
  32. data/spec/asciidoctor/rfc/v3/literal_spec.rb +20 -1
  33. data/spec/asciidoctor/rfc/v3/preamble_spec.rb +150 -0
  34. data/spec/asciidoctor/rfc/v3/references_spec.rb +35 -34
  35. data/spec/asciidoctor/rfc/v3/series_info_spec.rb +39 -0
  36. data/spec/examples/README.adoc +162 -0
  37. data/spec/examples/davies-template-bare-06.adoc +3 -0
  38. data/spec/examples/draft-ietf-core-block-xx.mkd +935 -0
  39. data/spec/examples/draft-ietf-core-block-xx.mkd.adoc +1013 -0
  40. data/spec/examples/draft-ietf-core-block-xx.xml.orig +1251 -0
  41. data/spec/examples/example-v2.adoc +6 -2
  42. data/spec/examples/example-v3.adoc +5 -1
  43. data/spec/examples/hoffmanv2.xml.adoc +247 -0
  44. data/spec/examples/hoffmanv2.xml.orig +339 -0
  45. data/spec/examples/hoffmanv3.xml.orig +346 -0
  46. data/spec/examples/mib-doc-template-xml-06.adoc +5 -1
  47. data/spec/examples/rfc2100.md.adoc +2 -3
  48. data/spec/examples/rfc3514.md.adoc +3 -2
  49. data/spec/examples/rfc5841.md.adoc +1 -1
  50. data/spec/examples/rfc748.md.adoc +7 -6
  51. data/spec/examples/rfc7511.md.adoc +15 -15
  52. data/spec/examples/skel.mkd +32 -0
  53. data/spec/examples/skel.mkd.adoc +50 -0
  54. data/spec/examples/skel.xml.orig +105 -0
  55. data/spec/examples/stupid-s.mkd +569 -0
  56. data/spec/examples/stupid-s.mkd.adoc +771 -0
  57. data/spec/examples/stupid-s.xml.orig +880 -0
  58. data/spec/spec_helper.rb +1 -1
  59. metadata +32 -4
@@ -12,6 +12,23 @@ describe Asciidoctor::RFC::V2::Converter do
12
12
  </figure>
13
13
  OUTPUT
14
14
  end
15
+ it "renders an image within an example" do
16
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
17
+ [[id1]]
18
+ .Example Title
19
+ [align=right,alt=Example]
20
+ ====
21
+ [[id]]
22
+ .Image Title
23
+ [align=center,alt=alt_text]
24
+ image::http:://www.example/org/filename.jpg[]
25
+ ====
26
+ INPUT
27
+ <figure anchor="id1" align="right" alt="Example" title="Example Title">
28
+ <artwork align="center" alt="alt_text" name="Image Title" src="http:://www.example/org/filename.jpg"/>
29
+ </figure>
30
+ OUTPUT
31
+ end
15
32
  it "renders an image with macro attributes" do
16
33
  expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
17
34
  [[id]]
@@ -174,4 +174,16 @@ describe Asciidoctor::RFC::V2::Converter do
174
174
  </rfc>
175
175
  OUTPUT
176
176
  end
177
+ it "renders line break" do
178
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
179
+ == Section 1
180
+ Hello +
181
+ This is a line break
182
+ INPUT
183
+ <section anchor="_section_1" title="Section 1">
184
+ <t>Hello<vspace/>
185
+ This is a line break</t>
186
+ </section>
187
+ OUTPUT
188
+ end
177
189
  end
@@ -19,6 +19,28 @@ describe Asciidoctor::RFC::V2::Converter do
19
19
  OUTPUT
20
20
  end
21
21
 
22
+ it "renders a listing block within an example" do
23
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
24
+ [#id]
25
+ ====
26
+ [[literal-id]]
27
+ .filename.rb
28
+ [source,ruby,src=http://example.com/ruby.rb,alt=Alt Text]
29
+ ----
30
+ def listing(node)
31
+ result = []
32
+ result << "<figure>" if node.parent.context != :example
33
+ end
34
+ ----
35
+ ====
36
+ INPUT
37
+ <figure anchor="id">
38
+ <artwork name="filename.rb" type="ruby" src="http://example.com/ruby.rb" alt="Alt Text">
39
+ </artwork>
40
+ </figure>
41
+ OUTPUT
42
+ end
43
+
22
44
  it "renders a listing block without source attribute" do
23
45
  expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
24
46
  [[literal-id]]
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
  describe Asciidoctor::RFC::V2::Converter do
3
- it "renders a listing" do
3
+ it "renders a literal" do
4
4
  expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
5
5
  [[literal-id]]
6
6
  .filename
@@ -44,7 +44,27 @@ describe Asciidoctor::RFC::V2::Converter do
44
44
  ++++
45
45
  INPUT
46
46
  <figure>
47
- <artwork>
47
+ <artwork align="center">
48
+ sqrt(4) = 2
49
+ </artwork>
50
+ </figure>
51
+ OUTPUT
52
+ end
53
+
54
+ it "renders stem as a literal within an example" do
55
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
56
+ :stem:
57
+
58
+ [#id]
59
+ ====
60
+ [stem]
61
+ ++++
62
+ sqrt(4) = 2
63
+ ++++
64
+ ====
65
+ INPUT
66
+ <figure anchor="id">
67
+ <artwork align="center">
48
68
  sqrt(4) = 2
49
69
  </artwork>
50
70
  </figure>
@@ -62,6 +62,39 @@ describe Asciidoctor::RFC::V2::Converter do
62
62
  OUTPUT
63
63
  end
64
64
 
65
+ it "renders verse in preamble as abstract" do
66
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
67
+ = Document title
68
+ Author
69
+ :docName:
70
+
71
+ [verse]
72
+ More Preamble content.
73
+
74
+ == Lorem
75
+ Ipsum.
76
+ INPUT
77
+ <?xml version="1.0" encoding="US-ASCII"?>
78
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
79
+
80
+ <rfc
81
+ submissionType="IETF">
82
+ <front>
83
+ <title>Document title</title>
84
+ <author fullname="Author"/>
85
+ <date day="1" month="January" year="2000"/>
86
+ <abstract>
87
+ <t>More Preamble content.</t>
88
+ </abstract>
89
+ </front><middle>
90
+ <section anchor="_lorem" title="Lorem">
91
+ <t>Ipsum.</t>
92
+ </section>
93
+ </middle>
94
+ </rfc>
95
+ OUTPUT
96
+ end
97
+
65
98
  it "renders admonitions in preamble as notes" do
66
99
  expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
67
100
  = Document title
@@ -98,6 +131,45 @@ describe Asciidoctor::RFC::V2::Converter do
98
131
  OUTPUT
99
132
  end
100
133
 
134
+ it "renders admonitions in preamble as notes, following an abstract" do
135
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
136
+ = Document title
137
+ Author
138
+ :docName:
139
+
140
+ Abstract
141
+
142
+ [NOTE]
143
+ .Title of Note
144
+ ====
145
+ This is another note.
146
+ ====
147
+
148
+ == Lorem
149
+ Ipsum.
150
+ INPUT
151
+ <?xml version="1.0" encoding="US-ASCII"?>
152
+ <!DOCTYPE rfc SYSTEM "rfc2629.dtd">
153
+
154
+ <rfc
155
+ submissionType="IETF">
156
+ <front>
157
+ <title>Document title</title>
158
+ <author fullname="Author"/>
159
+ <date day="1" month="January" year="2000"/>
160
+ <abstract><t>Abstract</t></abstract>
161
+ <note title="Title of Note">
162
+ <t>This is another note.</t>
163
+ </note>
164
+ </front><middle>
165
+ <section anchor="_lorem" title="Lorem">
166
+ <t>Ipsum.</t>
167
+ </section>
168
+ </middle>
169
+ </rfc>
170
+ OUTPUT
171
+ end
172
+
101
173
  it "supplies default titles for notes" do
102
174
  expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2, header_footer: true)).to be_equivalent_to <<~'OUTPUT'
103
175
  = Document title
@@ -37,6 +37,8 @@ describe Asciidoctor::RFC::V2::Converter do
37
37
 
38
38
  [bibliography]
39
39
  == References
40
+
41
+ === Normative References
40
42
  ++++
41
43
  <reference anchor='ISO.IEC.10118-3' target='https://www.iso.org/standard/67116.html'>
42
44
  <front>
@@ -66,7 +68,7 @@ describe Asciidoctor::RFC::V2::Converter do
66
68
  <section anchor="_text" title="Text">
67
69
  <t>Text</t>
68
70
  </section>
69
- <references title="References">
71
+ <references title="Normative References">
70
72
  <reference anchor='ISO.IEC.10118-3' target='https://www.iso.org/standard/67116.html'>
71
73
  <front>
72
74
  <title>ISO/IEC FDIS 10118-3 -- Information technology -- Security techniques -- Hash-functions -- Part 3: Dedicated hash-functions</title>
@@ -152,7 +152,7 @@ describe Asciidoctor::RFC::V2::Converter do
152
152
  |===
153
153
  INPUT
154
154
  <section anchor="_section_1" title="Section 1">
155
- <texttable title="Table Title" suppress-title="false" style="all">
155
+ <texttable title="Table Title" suppress-title="false" style="full">
156
156
  <ttcol align="left">head</ttcol>
157
157
  <ttcol align="left">head</ttcol>
158
158
  <c>header cell</c>
@@ -195,7 +195,7 @@ describe Asciidoctor::RFC::V2::Converter do
195
195
  |===
196
196
  INPUT
197
197
  <section anchor="_section_1" title="Section 1">
198
- <texttable title="Table Title" suppress-title="false" style="all">
198
+ <texttable title="Table Title" suppress-title="false" style="full">
199
199
  <ttcol align="left">head</ttcol>
200
200
  <ttcol align="left">head</ttcol>
201
201
  <c>header cell</c>
@@ -229,7 +229,7 @@ describe Asciidoctor::RFC::V2::Converter do
229
229
  |===
230
230
  INPUT
231
231
  <section anchor="_section_1" title="Section 1">
232
- <texttable suppress-title="false" style="all">
232
+ <texttable suppress-title="false" style="full">
233
233
  <ttcol align="left" width="12.5%">a</ttcol>
234
234
  <ttcol align="left" width="25%">b</ttcol>
235
235
  <ttcol align="left" width="62.5%">c</ttcol>
@@ -254,7 +254,7 @@ describe Asciidoctor::RFC::V2::Converter do
254
254
  |===
255
255
  INPUT
256
256
  <section anchor="_section_1" title="Section 1">
257
- <texttable suppress-title="false" style="all">
257
+ <texttable suppress-title="false" style="full">
258
258
  <ttcol align="left" width="10%">a</ttcol>
259
259
  <ttcol align="left" width="20%">b</ttcol>
260
260
  <ttcol align="left" width="70%">c</ttcol>
@@ -275,6 +275,31 @@ describe Asciidoctor::RFC::V2::Converter do
275
275
  |===
276
276
  |a |b |c
277
277
 
278
+ |a |b |c
279
+ |===
280
+ INPUT
281
+ <section anchor="_section_1" title="Section 1">
282
+ <texttable suppress-title="false" style="full">
283
+ <ttcol align="left">a</ttcol>
284
+ <ttcol align="left">b</ttcol>
285
+ <ttcol align="left">c</ttcol>
286
+ <c>a</c>
287
+ <c>b</c>
288
+ <c>c</c>
289
+ </texttable>
290
+ </section>
291
+ OUTPUT
292
+ end
293
+ it "renders table with grid=all" do
294
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
295
+ = Document title
296
+ Author
297
+
298
+ == Section 1
299
+ [grid=all]
300
+ |===
301
+ |a |b |c
302
+
278
303
  |a |b |c
279
304
  |===
280
305
  INPUT
@@ -290,4 +315,79 @@ describe Asciidoctor::RFC::V2::Converter do
290
315
  </section>
291
316
  OUTPUT
292
317
  end
318
+ it "renders table with grid=rows" do
319
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
320
+ = Document title
321
+ Author
322
+
323
+ == Section 1
324
+ [grid=rows]
325
+ |===
326
+ |a |b |c
327
+
328
+ |a |b |c
329
+ |===
330
+ INPUT
331
+ <section anchor="_section_1" title="Section 1">
332
+ <texttable suppress-title="false" style="none">
333
+ <ttcol align="left">a</ttcol>
334
+ <ttcol align="left">b</ttcol>
335
+ <ttcol align="left">c</ttcol>
336
+ <c>a</c>
337
+ <c>b</c>
338
+ <c>c</c>
339
+ </texttable>
340
+ </section>
341
+ OUTPUT
342
+ end
343
+ it "renders table with grid=cols" do
344
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
345
+ = Document title
346
+ Author
347
+
348
+ == Section 1
349
+ [grid=cols]
350
+ |===
351
+ |a |b |c
352
+
353
+ |a |b |c
354
+ |===
355
+ INPUT
356
+ <section anchor="_section_1" title="Section 1">
357
+ <texttable suppress-title="false" style="full">
358
+ <ttcol align="left">a</ttcol>
359
+ <ttcol align="left">b</ttcol>
360
+ <ttcol align="left">c</ttcol>
361
+ <c>a</c>
362
+ <c>b</c>
363
+ <c>c</c>
364
+ </texttable>
365
+ </section>
366
+ OUTPUT
367
+ end
368
+ it "renders table with grid=none" do
369
+ expect(Asciidoctor.convert(<<~'INPUT', backend: :rfc2)).to be_equivalent_to <<~'OUTPUT'
370
+ = Document title
371
+ Author
372
+
373
+ == Section 1
374
+ [grid=none]
375
+ |===
376
+ |a |b |c
377
+
378
+ |a |b |c
379
+ |===
380
+ INPUT
381
+ <section anchor="_section_1" title="Section 1">
382
+ <texttable suppress-title="false" style="none">
383
+ <ttcol align="left">a</ttcol>
384
+ <ttcol align="left">b</ttcol>
385
+ <ttcol align="left">c</ttcol>
386
+ <c>a</c>
387
+ <c>b</c>
388
+ <c>c</c>
389
+ </texttable>
390
+ </section>
391
+ OUTPUT
392
+ end
293
393
  end
@@ -0,0 +1,89 @@
1
+ require "spec_helper"
2
+
3
+ def text_compare(old_xml, new_xml)
4
+ File.write("#{old_xml}.1", norm(File.read(old_xml, encoding: "utf-8")))
5
+ File.write("#{new_xml}.1", norm(File.read(new_xml, encoding: "utf-8")))
6
+ system("xml2rfc #{old_xml}.1 -o #{old_xml}.txt")
7
+ system("xml2rfc #{new_xml}.1 -o #{new_xml}.txt")
8
+ end
9
+
10
+ def text_compare1(old_xml, new_xml)
11
+ system("xml2rfc #{old_xml} -o #{old_xml}.txt")
12
+ system("xml2rfc #{new_xml} -o #{new_xml}.txt")
13
+ end
14
+
15
+ def norm(text)
16
+ text.gsub(%r{<spanx style="strong">(MUST|MUST NOT|REQUIRED|SHALL|SHALL NOT|SHOULD|SHOULD NOT|RECOMMENDED|MAY|OPTIONAL)</spanx>}, "\\1")
17
+ end
18
+
19
+ describe Asciidoctor::RFC::V2::Converter do
20
+ it "processes Davies template with equivalent text" do
21
+ system("bin/asciidoctor-rfc2 spec/examples/davies-template-bare-06.adoc")
22
+ text_compare("spec/examples/davies-template-bare-06.xml.orig", "spec/examples/davies-template-bare-06.xml")
23
+ expect(norm(File.read("spec/examples/davies-template-bare-06.xml.orig.txt"))).to be_equivalent_to norm(File.read("spec/examples/davies-template-bare-06.xml.txt"))
24
+ end
25
+ it "processes MIB template with equivalent text" do
26
+ system("bin/asciidoctor-rfc2 spec/examples/mib-doc-template-xml-06.adoc")
27
+ text_compare("spec/examples/mib-doc-template-xml-06.xml.orig", "spec/examples/mib-doc-template-xml-06.xml")
28
+ expect(norm(File.read("spec/examples/mib-doc-template-xml-06.xml.orig.txt"))).to be_equivalent_to norm(File.read("spec/examples/mib-doc-template-xml-06.xml.txt"))
29
+ end
30
+ it "processes rfc1149 from Markdown with equivalent text" do
31
+ # leaving out step of running ./mmark
32
+ system("bin/asciidoctor-rfc2 spec/examples/rfc1149.md.adoc")
33
+ text_compare("spec/examples/rfc1149.md.2.xml", "spec/examples/rfc1149.md.xml")
34
+ expect(norm(File.read("spec/examples/rfc1149.md.2.xml.txt"))).to be_equivalent_to norm(File.read("spec/examples/rfc1149.md.xml.txt"))
35
+ end
36
+ it "processes rfc2100 from Markdown with equivalent text" do
37
+ # leaving out step of running ./mmark
38
+ system("bin/asciidoctor-rfc2 spec/examples/rfc2100.md.adoc")
39
+ text_compare("spec/examples/rfc2100.md.2.xml", "spec/examples/rfc2100.md.xml")
40
+ expect(norm(File.read("spec/examples/rfc2100.md.2.xml.txt"))).to be_equivalent_to norm(File.read("spec/examples/rfc2100.md.xml.txt"))
41
+ end
42
+ it "processes rfc3514 from Markdown with equivalent text" do
43
+ # leaving out step of running ./mmark
44
+ system("bin/asciidoctor-rfc2 spec/examples/rfc3514.md.adoc")
45
+ text_compare("spec/examples/rfc3514.md.2.xml", "spec/examples/rfc3514.md.xml")
46
+ expect(norm(File.read("spec/examples/rfc3514.md.2.xml.txt"))).to be_equivalent_to norm(File.read("spec/examples/rfc3514.md.xml.txt"))
47
+ end
48
+ it "processes rfc5841 from Markdown with equivalent text" do
49
+ # leaving out step of running ./mmark
50
+ system("bin/asciidoctor-rfc2 spec/examples/rfc5841.md.adoc")
51
+ text_compare("spec/examples/rfc5841.md.2.xml", "spec/examples/rfc5841.md.xml")
52
+ expect(norm(File.read("spec/examples/rfc5841.md.2.xml.txt"))).to be_equivalent_to norm(File.read("spec/examples/rfc5841.md.xml.txt"))
53
+ end
54
+ it "processes rfc748 from Markdown with equivalent text" do
55
+ # leaving out step of running ./mmark
56
+ system("bin/asciidoctor-rfc2 spec/examples/rfc748.md.adoc")
57
+ text_compare("spec/examples/rfc748.md.2.xml", "spec/examples/rfc748.md.xml")
58
+ expect(norm(File.read("spec/examples/rfc748.md.2.xml.txt"))).to be_equivalent_to norm(File.read("spec/examples/rfc748.md.xml.txt"))
59
+ end
60
+ it "processes rfc7511 from Markdown with equivalent text" do
61
+ # leaving out step of running ./mmark
62
+ system("bin/asciidoctor-rfc2 spec/examples/rfc7511.md.adoc")
63
+ text_compare("spec/examples/rfc7511.md.2.xml", "spec/examples/rfc7511.md.xml")
64
+ expect(norm(File.read("spec/examples/rfc7511.md.2.xml.txt"))).to be_equivalent_to norm(File.read("spec/examples/rfc7511.md.xml.txt"))
65
+ end
66
+ it "processes draft-ietf-core-block-xx from Kramdown with equivalent text" do
67
+ # leaving out step of running ./kramdown
68
+ system("bin/asciidoctor-rfc2 spec/examples/draft-ietf-core-block-xx.mkd.adoc")
69
+ text_compare("spec/examples/draft-ietf-core-block-xx.xml.orig", "spec/examples/draft-ietf-core-block-xx.mkd.xml")
70
+ expect(norm(File.read("spec/examples/draft-ietf-core-block-xx.xml.orig.txt"))).to be_equivalent_to norm(File.read("spec/examples/draft-ietf-core-block-xx.mkd.xml.txt"))
71
+ end
72
+ it "processes skel from Kramdown with equivalent text" do
73
+ # leaving out step of running ./kramdown
74
+ system("bin/asciidoctor-rfc2 spec/examples/skel.mkd.adoc")
75
+ text_compare1("spec/examples/skel.xml.orig", "spec/examples/skel.mkd.xml")
76
+ expect(File.read("spec/examples/skel.xml.orig.txt")).to be_equivalent_to File.read("spec/examples/skel.mkd.xml.txt")
77
+ end
78
+ it "processes stupid-s from Kramdown with equivalent text" do
79
+ # leaving out step of running ./kramdown
80
+ system("bin/asciidoctor-rfc2 spec/examples/stupid-s.mkd.adoc")
81
+ text_compare("spec/examples/stupid-s.xml.orig", "spec/examples/stupid-s.mkd.xml")
82
+ expect(File.read("spec/examples/stupid-s.xml.orig.txt")).to be_equivalent_to File.read("spec/examples/stupid-s.mkd.xml.txt")
83
+ end
84
+ it "processes Hoffman RFC XML v2 example with equivalent text" do
85
+ system("bin/asciidoctor-rfc2 spec/examples/hoffmanv2.xml.adoc")
86
+ text_compare("spec/examples/hoffmanv2.xml.orig", "spec/examples/hoffmanv2.xml.xml")
87
+ expect(norm(File.read("spec/examples/hoffmanv2.xml.orig.txt"))).to be_equivalent_to norm(File.read("spec/examples/hoffmanv2.xml.xml.txt"))
88
+ end
89
+ end