metanorma-standoc 2.2.6 → 2.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metanorma/standoc/base.rb +3 -5
- data/lib/metanorma/standoc/biblio.rng +5 -0
- data/lib/metanorma/standoc/cleanup.rb +17 -17
- data/lib/metanorma/standoc/cleanup_amend.rb +2 -2
- data/lib/metanorma/standoc/cleanup_biblio.rb +2 -1
- data/lib/metanorma/standoc/cleanup_maths.rb +12 -4
- data/lib/metanorma/standoc/cleanup_section.rb +19 -9
- data/lib/metanorma/standoc/cleanup_symbols.rb +14 -7
- data/lib/metanorma/standoc/cleanup_text.rb +10 -4
- data/lib/metanorma/standoc/cleanup_toc.rb +1 -2
- data/lib/metanorma/standoc/cleanup_xref.rb +55 -14
- data/lib/metanorma/standoc/inline.rb +27 -12
- data/lib/metanorma/standoc/isodoc.rng +46 -12
- data/lib/metanorma/standoc/ref_utility.rb +1 -0
- data/lib/metanorma/standoc/render.rb +10 -1
- data/lib/metanorma/standoc/section.rb +10 -3
- data/lib/metanorma/standoc/utils.rb +6 -1
- data/lib/metanorma/standoc/validate.rb +1 -1
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +5 -2
- metadata +4 -128
- data/.github/workflows/automerge.yml +0 -31
- data/.github/workflows/rake.yml +0 -15
- data/.github/workflows/release.yml +0 -24
- data/Rakefile +0 -8
- data/bin/rspec +0 -18
- data/spec/assets/a1.adoc +0 -8
- data/spec/assets/a2.adoc +0 -10
- data/spec/assets/a3.adoc +0 -9
- data/spec/assets/a3a.adoc +0 -7
- data/spec/assets/a4.adoc +0 -4
- data/spec/assets/boilerplate.xml +0 -4
- data/spec/assets/codes.yml +0 -695
- data/spec/assets/correct.png +0 -0
- data/spec/assets/corrupt.png +0 -0
- data/spec/assets/header.html +0 -7
- data/spec/assets/html-override.css +0 -1
- data/spec/assets/html.scss +0 -13
- data/spec/assets/htmlcover.html +0 -4
- data/spec/assets/htmlintro.html +0 -5
- data/spec/assets/i18n.yaml +0 -17
- data/spec/assets/iso.adoc +0 -10
- data/spec/assets/iso.headless.html +0 -33
- data/spec/assets/iso.xml +0 -8
- data/spec/assets/iso123.rxl +0 -107
- data/spec/assets/rice_image1.png +0 -0
- data/spec/assets/scripts.html +0 -3
- data/spec/assets/std.css +0 -2
- data/spec/assets/word-override.css +0 -1
- data/spec/assets/word.scss +0 -13
- data/spec/assets/wordcover.html +0 -3
- data/spec/assets/wordintro.html +0 -4
- data/spec/assets/xref_error.adoc +0 -8
- data/spec/examples/103_01_02.html +0 -247
- data/spec/examples/codes_table.html +0 -3174
- data/spec/examples/datamodel/address_class_profile.adoc +0 -5
- data/spec/examples/datamodel/address_class_profile.presentation.xml +0 -14
- data/spec/examples/datamodel/address_component_profile.adoc +0 -5
- data/spec/examples/datamodel/blank_definition_profile.adoc +0 -5
- data/spec/examples/datamodel/common_models_diagram.adoc +0 -5
- data/spec/examples/datamodel/models/models/AddressClassProfile.yml +0 -90
- data/spec/examples/datamodel/models/models/AddressComponentProfile.yml +0 -63
- data/spec/examples/datamodel/models/models/AddressComponentSpecification.yml +0 -15
- data/spec/examples/datamodel/models/models/AddressProfile.yml +0 -36
- data/spec/examples/datamodel/models/models/AttributeProfile.yml +0 -32
- data/spec/examples/datamodel/models/models/InterchangeAddressClassProfile.yml +0 -79
- data/spec/examples/datamodel/models/models/Localization copy.yml +0 -23
- data/spec/examples/datamodel/models/models/Localization.yml +0 -23
- data/spec/examples/datamodel/models/models/ProfileCompliantAddress.yml +0 -36
- data/spec/examples/datamodel/models/models/ProfileCompliantAddressComponent.yml +0 -15
- data/spec/examples/datamodel/models/models/Signature.yml +0 -20
- data/spec/examples/datamodel/models/models/SignatureBlankDefinition.yml +0 -20
- data/spec/examples/datamodel/models/models/TextDirectionCode copy.yml +0 -16
- data/spec/examples/datamodel/models/models/TextDirectionCode.yml +0 -16
- data/spec/examples/datamodel/models/models/Validity.yml +0 -14
- data/spec/examples/datamodel/models/models/iso19160-1/Address.yml +0 -22
- data/spec/examples/datamodel/models/models/iso19160-1/AddressComponent.yml +0 -2
- data/spec/examples/datamodel/models/style.uml.inc +0 -37
- data/spec/examples/datamodel/models/views/CommonModels.yml +0 -9
- data/spec/examples/datamodel/models/views/TopDown.yml +0 -62
- data/spec/examples/datamodel/top_down_diagram.adoc +0 -5
- data/spec/examples/english.yaml +0 -69
- data/spec/examples/iso_123_.xml +0 -46
- data/spec/examples/iso_123_all_parts.xml +0 -46
- data/spec/examples/iso_123_no_year_note.xml +0 -47
- data/spec/examples/iso_124_.xml +0 -42
- data/spec/examples/iso_216_.xml +0 -48
- data/spec/examples/iso_iec_12382_.xml +0 -49
- data/spec/examples/rice.adoc +0 -715
- data/spec/examples/rice.preview.html +0 -1877
- data/spec/examples/rice.sh +0 -4
- data/spec/examples/rice_images/rice_image1.png +0 -0
- data/spec/examples/rice_images/rice_image2.png +0 -0
- data/spec/examples/rice_images/rice_image3_1.png +0 -0
- data/spec/examples/rice_images/rice_image3_2.png +0 -0
- data/spec/examples/rice_images/rice_image3_3.png +0 -0
- data/spec/fixtures/action_schemaexpg1.svg +0 -122
- data/spec/fixtures/datamodel_description_sections_tree.xml +0 -327
- data/spec/fixtures/diagram_definitions.lutaml +0 -22
- data/spec/fixtures/macros_datamodel/address_class_profile.xml +0 -149
- data/spec/fixtures/macros_datamodel/address_component_profile.xml +0 -71
- data/spec/fixtures/macros_datamodel/blank_definition_profile.xml +0 -51
- data/spec/fixtures/macros_datamodel/common_models_diagram.xml +0 -7
- data/spec/fixtures/macros_datamodel/top_down_diagram.xml +0 -7
- data/spec/fixtures/test.exp +0 -121
- data/spec/fixtures/test.xmi +0 -9250
- data/spec/metanorma/base_spec.rb +0 -1125
- data/spec/metanorma/biblio_spec.rb +0 -1012
- data/spec/metanorma/blank_spec.rb +0 -37
- data/spec/metanorma/blocks_spec.rb +0 -1784
- data/spec/metanorma/cleanup_blocks_spec.rb +0 -1099
- data/spec/metanorma/cleanup_sections_spec.rb +0 -1849
- data/spec/metanorma/cleanup_spec.rb +0 -1931
- data/spec/metanorma/cleanup_terms_spec.rb +0 -1543
- data/spec/metanorma/datamodel/attributes_table_preprocessor_spec.rb +0 -111
- data/spec/metanorma/datamodel/diagram_preprocessor_spec.rb +0 -72
- data/spec/metanorma/inline_spec.rb +0 -785
- data/spec/metanorma/isobib_cache_spec.rb +0 -742
- data/spec/metanorma/lists_spec.rb +0 -232
- data/spec/metanorma/macros_concept_spec.rb +0 -1052
- data/spec/metanorma/macros_json2text_spec.rb +0 -10
- data/spec/metanorma/macros_plantuml_spec.rb +0 -402
- data/spec/metanorma/macros_spec.rb +0 -1183
- data/spec/metanorma/macros_yaml2text_spec.rb +0 -10
- data/spec/metanorma/processor_spec.rb +0 -96
- data/spec/metanorma/refs_spec.rb +0 -2807
- data/spec/metanorma/reqt_spec.rb +0 -130
- data/spec/metanorma/section_spec.rb +0 -1325
- data/spec/metanorma/table_spec.rb +0 -474
- data/spec/metanorma/validate_spec.rb +0 -886
- data/spec/spec_helper.rb +0 -290
- data/spec/support/shared_examples/structured_data_2_text_preprocessor.rb +0 -781
- data/spec/vcr_cassettes/bsi16341.yml +0 -486
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +0 -611
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +0 -149
- data/spec/vcr_cassettes/hide_refs.yml +0 -587
- data/spec/vcr_cassettes/isobib_get_123.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_123_1.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +0 -385
- data/spec/vcr_cassettes/isobib_get_123_2.yml +0 -295
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +0 -149
- data/spec/vcr_cassettes/isobib_get_124.yml +0 -149
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +0 -367
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +0 -560
- data/spec/vcr_cassettes/std-link.yml +0 -149
@@ -1,402 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
RSpec.describe Metanorma::Standoc do
|
4
|
-
it "processes the PlantUML macro" do
|
5
|
-
input = <<~INPUT
|
6
|
-
#{ASCIIDOC_BLANK_HDR}
|
7
|
-
|
8
|
-
[plantuml]
|
9
|
-
....
|
10
|
-
@startuml
|
11
|
-
Alice -> Bob: Authentication Request
|
12
|
-
Bob --> Alice: Authentication Response
|
13
|
-
|
14
|
-
Alice -> Bob: Another authentication Request
|
15
|
-
Alice <-- Bob: another authentication Response
|
16
|
-
@enduml
|
17
|
-
....
|
18
|
-
|
19
|
-
[plantuml]
|
20
|
-
....
|
21
|
-
Alice -> Bob: Authentication Request
|
22
|
-
Bob --> Alice: Authentication Response
|
23
|
-
|
24
|
-
Alice -> Bob: Another authentication Request
|
25
|
-
Alice <-- Bob: another authentication Response
|
26
|
-
....
|
27
|
-
|
28
|
-
[plantuml]
|
29
|
-
....
|
30
|
-
@startuml filename
|
31
|
-
Alice -> Bob: Authentication Request
|
32
|
-
Bob --> Alice: Authentication Response
|
33
|
-
|
34
|
-
Alice -> Bob: Another authentication Request
|
35
|
-
Alice <-- Bob: another authentication Response
|
36
|
-
@enduml
|
37
|
-
....
|
38
|
-
INPUT
|
39
|
-
output = <<~OUTPUT
|
40
|
-
#{BLANK_HDR}
|
41
|
-
<sections><figure id="_">
|
42
|
-
<image src="plantuml/_.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
43
|
-
</figure>
|
44
|
-
<figure id="_">
|
45
|
-
<image src="plantuml/_.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
46
|
-
</figure>
|
47
|
-
<figure id="_">
|
48
|
-
<image src="plantuml/filename.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
49
|
-
</figure>
|
50
|
-
</sections>
|
51
|
-
</standard-document>
|
52
|
-
OUTPUT
|
53
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))
|
54
|
-
.gsub(%r{plantuml/plantuml[^./]+\.}, "plantuml/_.")))
|
55
|
-
.to be_equivalent_to xmlpp(output)
|
56
|
-
end
|
57
|
-
|
58
|
-
it "processes the PlantUML macro with imagesdir" do
|
59
|
-
input = <<~INPUT
|
60
|
-
= Document title
|
61
|
-
Author
|
62
|
-
:docfile: test.adoc
|
63
|
-
:nodoc:
|
64
|
-
:novalid:
|
65
|
-
:no-isobib:
|
66
|
-
:imagesdir: spec/assets
|
67
|
-
:data-uri-image: false
|
68
|
-
|
69
|
-
[plantuml]
|
70
|
-
....
|
71
|
-
@startuml
|
72
|
-
Alice -> Bob: Authentication Request
|
73
|
-
Bob --> Alice: Authentication Response
|
74
|
-
|
75
|
-
Alice -> Bob: Another authentication Request
|
76
|
-
Alice <-- Bob: another authentication Response
|
77
|
-
@enduml
|
78
|
-
....
|
79
|
-
INPUT
|
80
|
-
output = <<~OUTPUT
|
81
|
-
#{BLANK_HDR}
|
82
|
-
<sections>
|
83
|
-
<figure id="_">
|
84
|
-
<image src="spec/assets/_.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
85
|
-
</figure>
|
86
|
-
</sections>
|
87
|
-
</standard-document>
|
88
|
-
OUTPUT
|
89
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))
|
90
|
-
.gsub(%r{spec/assets/[^./]+\.}, "spec/assets/_.")))
|
91
|
-
.to be_equivalent_to xmlpp(output)
|
92
|
-
end
|
93
|
-
|
94
|
-
context "when lutaml_diagram" do
|
95
|
-
let(:input) do
|
96
|
-
<<~"OUTPUT"
|
97
|
-
= Document title
|
98
|
-
Author
|
99
|
-
:docfile: test.adoc
|
100
|
-
:nodoc:
|
101
|
-
:novalid:
|
102
|
-
:no-isobib:
|
103
|
-
:imagesdir: spec/assets
|
104
|
-
:data-uri-image: false
|
105
|
-
|
106
|
-
[lutaml_diagram]
|
107
|
-
....
|
108
|
-
diagram MyView {
|
109
|
-
fontname "Arial"
|
110
|
-
title "my diagram"
|
111
|
-
class Foo {}
|
112
|
-
}
|
113
|
-
....
|
114
|
-
OUTPUT
|
115
|
-
end
|
116
|
-
let(:output) do
|
117
|
-
<<~"OUTPUT"
|
118
|
-
#{BLANK_HDR}
|
119
|
-
<sections>
|
120
|
-
<figure id="_">
|
121
|
-
<image src="spec/assets/_.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
122
|
-
</figure>
|
123
|
-
</sections>
|
124
|
-
</standard-document>
|
125
|
-
OUTPUT
|
126
|
-
end
|
127
|
-
|
128
|
-
it "processes the lutaml_diagram" do
|
129
|
-
expect(
|
130
|
-
xmlpp(
|
131
|
-
strip_guid(Asciidoctor.convert(input, *OPTIONS))
|
132
|
-
.gsub(%r{spec/assets/lutaml/[^./]+\.png},
|
133
|
-
"spec/assets/_.png"),
|
134
|
-
),
|
135
|
-
).to(be_equivalent_to(xmlpp(output)))
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
context "when inline macro, path supplied as the second arg" do
|
140
|
-
let(:example_file) { fixtures_path("diagram_definitions.lutaml") }
|
141
|
-
let(:input) do
|
142
|
-
<<~TEXT
|
143
|
-
= Document title
|
144
|
-
Author
|
145
|
-
:docfile: test.adoc
|
146
|
-
:nodoc:
|
147
|
-
:novalid:
|
148
|
-
:no-isobib:
|
149
|
-
:imagesdir: spec/assets
|
150
|
-
:data-uri-image: false
|
151
|
-
|
152
|
-
lutaml_diagram::#{example_file}[]
|
153
|
-
|
154
|
-
TEXT
|
155
|
-
end
|
156
|
-
let(:output) do
|
157
|
-
<<~TEXT
|
158
|
-
#{BLANK_HDR}
|
159
|
-
<sections>
|
160
|
-
<figure id="_">
|
161
|
-
<image src="spec/assets/_.png" id="_" mimetype="image/png" height="auto" width="auto"/>
|
162
|
-
</figure>
|
163
|
-
</sections>
|
164
|
-
</standard-document>
|
165
|
-
TEXT
|
166
|
-
end
|
167
|
-
|
168
|
-
it "correctly renders input" do
|
169
|
-
expect(
|
170
|
-
xmlpp(
|
171
|
-
strip_guid(Asciidoctor.convert(input, *OPTIONS))
|
172
|
-
.gsub(%r{spec/assets/lutaml/[^./]+\.png},
|
173
|
-
"spec/assets/_.png"),
|
174
|
-
),
|
175
|
-
).to(be_equivalent_to(xmlpp(output)))
|
176
|
-
end
|
177
|
-
end
|
178
|
-
|
179
|
-
context "when lutaml_uml_attributes_table" do
|
180
|
-
let(:example_file) { fixtures_path("diagram_definitions.lutaml") }
|
181
|
-
let(:input) do
|
182
|
-
<<~"OUTPUT"
|
183
|
-
= Document title
|
184
|
-
Author
|
185
|
-
:docfile: test.adoc
|
186
|
-
:nodoc:
|
187
|
-
:novalid:
|
188
|
-
:no-isobib:
|
189
|
-
:imagesdir: spec/assets
|
190
|
-
|
191
|
-
[lutaml_uml_attributes_table,#{example_file},AttributeProfile]
|
192
|
-
OUTPUT
|
193
|
-
end
|
194
|
-
let(:output) do
|
195
|
-
<<~"OUTPUT"
|
196
|
-
#{BLANK_HDR}
|
197
|
-
<sections>
|
198
|
-
<clause id='_' inline-header='false' obligation='normative'>
|
199
|
-
<title>AttributeProfile</title>
|
200
|
-
<table id='_'>
|
201
|
-
<name>AttributeProfile attributes</name>
|
202
|
-
<thead>
|
203
|
-
<tr>
|
204
|
-
<th valign='top' align='left'>Name</th>
|
205
|
-
<th valign='top' align='left'>Definition</th>
|
206
|
-
<th valign='top' align='left'>Mandatory / Optional / Conditional</th>
|
207
|
-
<th valign='top' align='left'>Max Occur</th>
|
208
|
-
<th valign='top' align='left'>Data Type</th>
|
209
|
-
</tr>
|
210
|
-
</thead>
|
211
|
-
<tbody>
|
212
|
-
<tr>
|
213
|
-
<td valign='top' align='left'>addressClassProfile</td>
|
214
|
-
<td valign='top' align='left'></td>
|
215
|
-
<td valign='top' align='left'>O</td>
|
216
|
-
<td valign='top' align='left'>1</td>
|
217
|
-
<td valign='top' align='left'>
|
218
|
-
<tt>CharacterString</tt>
|
219
|
-
</td>
|
220
|
-
</tr>
|
221
|
-
<tr>
|
222
|
-
<td valign='top' align='left'>imlicistAttributeProfile</td>
|
223
|
-
<td valign='top' align='left'>this is attribute definition with multiply lines</td>
|
224
|
-
<td valign='top' align='left'>O</td>
|
225
|
-
<td valign='top' align='left'>1</td>
|
226
|
-
<td valign='top' align='left'>
|
227
|
-
<tt>CharacterString</tt>
|
228
|
-
</td>
|
229
|
-
</tr>
|
230
|
-
</tbody>
|
231
|
-
</table>
|
232
|
-
</clause>
|
233
|
-
</sections>
|
234
|
-
</standard-document>
|
235
|
-
OUTPUT
|
236
|
-
end
|
237
|
-
|
238
|
-
it "processes the lutaml_uml_attributes_table macro" do
|
239
|
-
expect(
|
240
|
-
xmlpp(
|
241
|
-
strip_guid(Asciidoctor.convert(input, *OPTIONS)),
|
242
|
-
),
|
243
|
-
)
|
244
|
-
.to(be_equivalent_to(xmlpp(output)))
|
245
|
-
end
|
246
|
-
end
|
247
|
-
|
248
|
-
it "processes the PlantUML macro with PlantUML disabled" do
|
249
|
-
mock_plantuml_disabled
|
250
|
-
input = <<~INPUT
|
251
|
-
#{ASCIIDOC_BLANK_HDR}
|
252
|
-
|
253
|
-
[plantuml]
|
254
|
-
....
|
255
|
-
@startuml
|
256
|
-
Alice -> Bob: Authentication Request
|
257
|
-
Bob --> Alice: Authentication Response
|
258
|
-
|
259
|
-
Alice -> Bob: Another authentication Request
|
260
|
-
Alice <-- Bob: another authentication Response
|
261
|
-
@enduml
|
262
|
-
....
|
263
|
-
INPUT
|
264
|
-
expect { Asciidoctor.convert(input, *OPTIONS) }
|
265
|
-
.to output(%r{PlantUML not installed}).to_stderr
|
266
|
-
|
267
|
-
mock_plantuml_disabled
|
268
|
-
input = <<~INPUT
|
269
|
-
#{ASCIIDOC_BLANK_HDR}
|
270
|
-
|
271
|
-
[plantuml]
|
272
|
-
....
|
273
|
-
@startuml
|
274
|
-
Alice -> Bob: Authentication Request
|
275
|
-
Bob --> Alice: Authentication Response
|
276
|
-
|
277
|
-
Alice -> Bob: Another authentication Request
|
278
|
-
Alice <-- Bob: another authentication Response
|
279
|
-
@enduml
|
280
|
-
....
|
281
|
-
INPUT
|
282
|
-
output = <<~OUTPUT
|
283
|
-
#{BLANK_HDR}
|
284
|
-
<sections>
|
285
|
-
<sourcecode id="_" lang="plantuml">@startuml
|
286
|
-
Alice -> Bob: Authentication Request
|
287
|
-
Bob --> Alice: Authentication Response
|
288
|
-
|
289
|
-
Alice -> Bob: Another authentication Request
|
290
|
-
Alice <-- Bob: another authentication Response
|
291
|
-
@enduml</sourcecode>
|
292
|
-
</sections>
|
293
|
-
</standard-document>
|
294
|
-
OUTPUT
|
295
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
296
|
-
.to be_equivalent_to xmlpp(output)
|
297
|
-
end
|
298
|
-
|
299
|
-
it "processes the PlantUML macro with localdir unwritable" do
|
300
|
-
mock_localdir_unwritable
|
301
|
-
input = <<~INPUT
|
302
|
-
#{ASCIIDOC_BLANK_HDR}
|
303
|
-
|
304
|
-
[plantuml]
|
305
|
-
....
|
306
|
-
@startuml
|
307
|
-
Alice -> Bob: Authentication Request
|
308
|
-
Bob --> Alice: Authentication Response
|
309
|
-
|
310
|
-
Alice -> Bob: Another authentication Request
|
311
|
-
Alice <-- Bob: another authentication Response
|
312
|
-
@enduml
|
313
|
-
....
|
314
|
-
INPUT
|
315
|
-
expect { Asciidoctor.convert(input, *OPTIONS) }
|
316
|
-
.to output(%r{not writable for PlantUML}).to_stderr
|
317
|
-
|
318
|
-
mock_localdir_unwritable
|
319
|
-
input = <<~INPUT
|
320
|
-
#{ASCIIDOC_BLANK_HDR}
|
321
|
-
|
322
|
-
[plantuml]
|
323
|
-
....
|
324
|
-
@startuml
|
325
|
-
Alice -> Bob: Authentication Request
|
326
|
-
Bob --> Alice: Authentication Response
|
327
|
-
|
328
|
-
Alice -> Bob: Another authentication Request
|
329
|
-
Alice <-- Bob: another authentication Response
|
330
|
-
@enduml
|
331
|
-
....
|
332
|
-
INPUT
|
333
|
-
output = <<~OUTPUT
|
334
|
-
#{BLANK_HDR}
|
335
|
-
<sections>
|
336
|
-
<sourcecode id="_" lang="plantuml">@startuml
|
337
|
-
Alice -> Bob: Authentication Request
|
338
|
-
Bob --> Alice: Authentication Response
|
339
|
-
|
340
|
-
Alice -> Bob: Another authentication Request
|
341
|
-
Alice <-- Bob: another authentication Response
|
342
|
-
@enduml</sourcecode>
|
343
|
-
</sections>
|
344
|
-
</standard-document>
|
345
|
-
OUTPUT
|
346
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
347
|
-
.to be_equivalent_to xmlpp(output)
|
348
|
-
end
|
349
|
-
|
350
|
-
it "processes the PlantUML macro with mismatched delimiters" do
|
351
|
-
input = <<~INPUT
|
352
|
-
#{ASCIIDOC_BLANK_HDR}
|
353
|
-
|
354
|
-
[plantuml]
|
355
|
-
....
|
356
|
-
@startuml
|
357
|
-
Alice -> Bob: Authentication Request
|
358
|
-
Bob --> Alice: Authentication Response
|
359
|
-
|
360
|
-
Alice -> Bob: Another authentication Request
|
361
|
-
Alice <-- Bob: another authentication Response
|
362
|
-
....
|
363
|
-
INPUT
|
364
|
-
expect { Asciidoctor.convert(input, *OPTIONS) }
|
365
|
-
.to output(%r{@startuml without matching @enduml in PlantUML!}).to_stderr
|
366
|
-
output = <<~OUTPUT
|
367
|
-
#{BLANK_HDR}
|
368
|
-
<sections>
|
369
|
-
<sourcecode id="_" lang="plantuml">@startuml
|
370
|
-
Alice -> Bob: Authentication Request
|
371
|
-
Bob --> Alice: Authentication Response
|
372
|
-
|
373
|
-
Alice -> Bob: Another authentication Request
|
374
|
-
Alice <-- Bob: another authentication Response</sourcecode>
|
375
|
-
</sections>
|
376
|
-
</standard-document>
|
377
|
-
OUTPUT
|
378
|
-
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
379
|
-
.to be_equivalent_to xmlpp(output)
|
380
|
-
end
|
381
|
-
|
382
|
-
private
|
383
|
-
|
384
|
-
def mock_plantuml_disabled
|
385
|
-
expect(Metanorma::Standoc::PlantUMLBlockMacroBackend)
|
386
|
-
.to receive(:plantuml_installed?) do
|
387
|
-
raise "PlantUML not installed"
|
388
|
-
end
|
389
|
-
end
|
390
|
-
|
391
|
-
def mock_localdir_unwritable
|
392
|
-
expect(Metanorma::Standoc::Utils).to receive(:localdir) do
|
393
|
-
"/"
|
394
|
-
end.exactly(2).times
|
395
|
-
end
|
396
|
-
|
397
|
-
def mock_localdir_unwritable
|
398
|
-
expect(File).to receive(:writable?) do
|
399
|
-
false
|
400
|
-
end
|
401
|
-
end
|
402
|
-
end
|