asciidoctor-diagram 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +12 -0
- data/README.adoc +4 -1
- data/lib/asciidoctor-diagram.rb +1 -0
- data/lib/asciidoctor-diagram/blockdiag/extension.rb +5 -4
- data/lib/asciidoctor-diagram/erd.rb +7 -0
- data/lib/asciidoctor-diagram/erd/extension.rb +43 -0
- data/lib/asciidoctor-diagram/extensions.rb +9 -5
- data/lib/asciidoctor-diagram/graphviz/extension.rb +2 -1
- data/lib/asciidoctor-diagram/meme/extension.rb +4 -4
- data/lib/asciidoctor-diagram/mermaid/extension.rb +4 -2
- data/lib/asciidoctor-diagram/plantuml/extension.rb +1 -1
- data/lib/asciidoctor-diagram/shaape/extension.rb +2 -1
- data/lib/asciidoctor-diagram/util/cli.rb +19 -0
- data/lib/asciidoctor-diagram/util/cli_generator.rb +5 -15
- data/lib/asciidoctor-diagram/util/java.rb +1 -1
- data/lib/asciidoctor-diagram/util/java_socket.rb +96 -28
- data/lib/asciidoctor-diagram/util/platform.rb +35 -14
- data/lib/asciidoctor-diagram/version.rb +1 -1
- data/lib/asciidoctor-diagram/wavedrom/extension.rb +3 -2
- data/spec/blockdiag_spec.rb +15 -15
- data/spec/ditaa_spec.rb +14 -14
- data/spec/erd_spec.rb +289 -0
- data/spec/graphviz_spec.rb +12 -12
- data/spec/meme_spec.rb +6 -6
- data/spec/mermaid_spec.rb +22 -22
- data/spec/plantuml_spec.rb +78 -42
- data/spec/shaape_spec.rb +15 -15
- data/spec/test_helper.rb +8 -3
- data/spec/wavedrom_spec.rb +18 -18
- metadata +8 -4
data/spec/graphviz_spec.rb
CHANGED
@@ -27,15 +27,15 @@ graphviz::graphviz.txt[format="png"]
|
|
27
27
|
d = load_asciidoc doc
|
28
28
|
expect(d).to_not be_nil
|
29
29
|
|
30
|
-
b = d.find { |
|
30
|
+
b = d.find { |bl| bl.context == :image }
|
31
31
|
expect(b).to_not be_nil
|
32
32
|
|
33
33
|
expect(b.content_model).to eq :empty
|
34
34
|
|
35
35
|
target = b.attributes['target']
|
36
36
|
expect(target).to_not be_nil
|
37
|
-
expect(target).to match
|
38
|
-
expect(File.
|
37
|
+
expect(target).to match(/\.png$/)
|
38
|
+
expect(File.exist?(target)).to be true
|
39
39
|
|
40
40
|
expect(b.attributes['width']).to_not be_nil
|
41
41
|
expect(b.attributes['height']).to_not be_nil
|
@@ -66,15 +66,15 @@ digraph foo {
|
|
66
66
|
d = load_asciidoc doc
|
67
67
|
expect(d).to_not be_nil
|
68
68
|
|
69
|
-
b = d.find { |
|
69
|
+
b = d.find { |bl| bl.context == :image }
|
70
70
|
expect(b).to_not be_nil
|
71
71
|
|
72
72
|
expect(b.content_model).to eq :empty
|
73
73
|
|
74
74
|
target = b.attributes['target']
|
75
75
|
expect(target).to_not be_nil
|
76
|
-
expect(target).to match
|
77
|
-
expect(File.
|
76
|
+
expect(target).to match(/\.png$/)
|
77
|
+
expect(File.exist?(target)).to be true
|
78
78
|
|
79
79
|
expect(b.attributes['width']).to_not be_nil
|
80
80
|
expect(b.attributes['height']).to_not be_nil
|
@@ -103,15 +103,15 @@ digraph foo {
|
|
103
103
|
d = load_asciidoc doc
|
104
104
|
expect(d).to_not be_nil
|
105
105
|
|
106
|
-
b = d.find { |
|
106
|
+
b = d.find { |bl| bl.context == :image }
|
107
107
|
expect(b).to_not be_nil
|
108
108
|
|
109
109
|
expect(b.content_model).to eq :empty
|
110
110
|
|
111
111
|
target = b.attributes['target']
|
112
112
|
expect(target).to_not be_nil
|
113
|
-
expect(target).to match
|
114
|
-
expect(File.
|
113
|
+
expect(target).to match(/\.svg$/)
|
114
|
+
expect(File.exist?(target)).to be true
|
115
115
|
|
116
116
|
expect(b.attributes['width']).to_not be_nil
|
117
117
|
expect(b.attributes['height']).to_not be_nil
|
@@ -129,7 +129,7 @@ Doc Writer <doc@example.com>
|
|
129
129
|
----
|
130
130
|
eos
|
131
131
|
|
132
|
-
expect { load_asciidoc doc }.to raise_error
|
132
|
+
expect { load_asciidoc doc }.to raise_error(/support.*format/i)
|
133
133
|
end
|
134
134
|
|
135
135
|
it "should support neato layout engine" do
|
@@ -148,12 +148,12 @@ digraph g { rankdir=LR; Text->Graphviz->Image }
|
|
148
148
|
d = load_asciidoc doc
|
149
149
|
expect(d).to_not be_nil
|
150
150
|
|
151
|
-
b = d.find { |
|
151
|
+
b = d.find { |bl| bl.context == :image }
|
152
152
|
expect(b).to_not be_nil
|
153
153
|
|
154
154
|
expect(b.content_model).to eq :empty
|
155
155
|
|
156
156
|
target = b.attributes['target']
|
157
|
-
expect(File.
|
157
|
+
expect(File.exist?(target)).to be true
|
158
158
|
end
|
159
159
|
end
|
data/spec/meme_spec.rb
CHANGED
@@ -19,15 +19,15 @@ meme::man.jpg[I don't always // write unit tests, but when I do // they generate
|
|
19
19
|
d = load_asciidoc doc
|
20
20
|
expect(d).to_not be_nil
|
21
21
|
|
22
|
-
b = d.find { |
|
22
|
+
b = d.find { |bl| bl.context == :image }
|
23
23
|
expect(b).to_not be_nil
|
24
24
|
|
25
25
|
expect(b.content_model).to eq :empty
|
26
26
|
|
27
27
|
target = b.attributes['target']
|
28
28
|
expect(target).to_not be_nil
|
29
|
-
expect(target).to match
|
30
|
-
expect(File.
|
29
|
+
expect(target).to match(/\.png$/)
|
30
|
+
expect(File.exist?(target)).to be true
|
31
31
|
|
32
32
|
expect(b.attributes['width']).to_not be_nil
|
33
33
|
expect(b.attributes['height']).to_not be_nil
|
@@ -51,15 +51,15 @@ meme::man.jpg[I don't always // write unit tests, but when I do // they generate
|
|
51
51
|
d = load_asciidoc doc
|
52
52
|
expect(d).to_not be_nil
|
53
53
|
|
54
|
-
b = d.find { |
|
54
|
+
b = d.find { |bl| bl.context == :image }
|
55
55
|
expect(b).to_not be_nil
|
56
56
|
|
57
57
|
expect(b.content_model).to eq :empty
|
58
58
|
|
59
59
|
target = b.attributes['target']
|
60
60
|
expect(target).to_not be_nil
|
61
|
-
expect(target).to match
|
62
|
-
expect(File.
|
61
|
+
expect(target).to match(/\.gif/)
|
62
|
+
expect(File.exist?(target)).to be true
|
63
63
|
|
64
64
|
expect(b.attributes['width']).to_not be_nil
|
65
65
|
expect(b.attributes['height']).to_not be_nil
|
data/spec/mermaid_spec.rb
CHANGED
@@ -24,15 +24,15 @@ mermaid::mermaid.txt[format="png"]
|
|
24
24
|
d = load_asciidoc doc
|
25
25
|
expect(d).to_not be_nil
|
26
26
|
|
27
|
-
b = d.find { |
|
27
|
+
b = d.find { |bl| bl.context == :image }
|
28
28
|
expect(b).to_not be_nil
|
29
29
|
|
30
30
|
expect(b.content_model).to eq :empty
|
31
31
|
|
32
32
|
target = b.attributes['target']
|
33
33
|
expect(target).to_not be_nil
|
34
|
-
expect(target).to match
|
35
|
-
expect(File.
|
34
|
+
expect(target).to match(/\.png$/)
|
35
|
+
expect(File.exist?(target)).to be true
|
36
36
|
|
37
37
|
expect(b.attributes['width']).to_not be_nil
|
38
38
|
expect(b.attributes['height']).to_not be_nil
|
@@ -53,15 +53,15 @@ mermaid::mermaid.txt[format="svg"]
|
|
53
53
|
d = load_asciidoc doc
|
54
54
|
expect(d).to_not be_nil
|
55
55
|
|
56
|
-
b = d.find { |
|
56
|
+
b = d.find { |bl| bl.context == :image }
|
57
57
|
expect(b).to_not be_nil
|
58
58
|
|
59
59
|
expect(b.content_model).to eq :empty
|
60
60
|
|
61
61
|
target = b.attributes['target']
|
62
62
|
expect(target).to_not be_nil
|
63
|
-
expect(target).to match
|
64
|
-
expect(File.
|
63
|
+
expect(target).to match(/\.svg/)
|
64
|
+
expect(File.exist?(target)).to be true
|
65
65
|
|
66
66
|
expect(b.attributes['width']).to_not be_nil
|
67
67
|
expect(b.attributes['height']).to_not be_nil
|
@@ -85,15 +85,15 @@ Doc Writer <doc@example.com>
|
|
85
85
|
d = load_asciidoc doc
|
86
86
|
expect(d).to_not be_nil
|
87
87
|
|
88
|
-
b = d.find { |
|
88
|
+
b = d.find { |bl| bl.context == :image }
|
89
89
|
expect(b).to_not be_nil
|
90
90
|
|
91
91
|
expect(b.content_model).to eq :empty
|
92
92
|
|
93
93
|
target = b.attributes['target']
|
94
94
|
expect(target).to_not be_nil
|
95
|
-
expect(target).to match
|
96
|
-
expect(File.
|
95
|
+
expect(target).to match(/\.png$/)
|
96
|
+
expect(File.exist?(target)).to be true
|
97
97
|
|
98
98
|
expect(b.attributes['width']).to_not be_nil
|
99
99
|
expect(b.attributes['height']).to_not be_nil
|
@@ -115,15 +115,15 @@ Doc Writer <doc@example.com>
|
|
115
115
|
d = load_asciidoc doc
|
116
116
|
expect(d).to_not be_nil
|
117
117
|
|
118
|
-
b = d.find { |
|
118
|
+
b = d.find { |bl| bl.context == :image }
|
119
119
|
expect(b).to_not be_nil
|
120
120
|
|
121
121
|
expect(b.content_model).to eq :empty
|
122
122
|
|
123
123
|
target = b.attributes['target']
|
124
124
|
expect(target).to_not be_nil
|
125
|
-
expect(target).to match
|
126
|
-
expect(File.
|
125
|
+
expect(target).to match(/\.svg/)
|
126
|
+
expect(File.exist?(target)).to be true
|
127
127
|
|
128
128
|
expect(b.attributes['width']).to_not be_nil
|
129
129
|
expect(b.attributes['height']).to_not be_nil
|
@@ -141,7 +141,7 @@ Doc Writer <doc@example.com>
|
|
141
141
|
----
|
142
142
|
eos
|
143
143
|
|
144
|
-
expect { load_asciidoc doc }.to raise_error
|
144
|
+
expect { load_asciidoc doc }.to raise_error(/support.*format/i)
|
145
145
|
end
|
146
146
|
|
147
147
|
it "should not regenerate images when source has not changed" do
|
@@ -162,7 +162,7 @@ mermaid::mermaid.txt
|
|
162
162
|
eos
|
163
163
|
|
164
164
|
d = load_asciidoc doc
|
165
|
-
b = d.find { |
|
165
|
+
b = d.find { |bl| bl.context == :image }
|
166
166
|
expect(b).to_not be_nil
|
167
167
|
target = b.attributes['target']
|
168
168
|
mtime1 = File.mtime(target)
|
@@ -190,7 +190,7 @@ mermaid::mermaid.txt[]
|
|
190
190
|
eos
|
191
191
|
|
192
192
|
load_asciidoc doc
|
193
|
-
expect(File.
|
193
|
+
expect(File.exist?('mermaid.png')).to be true
|
194
194
|
end
|
195
195
|
|
196
196
|
it "should respect target attribute in block macros" do
|
@@ -207,9 +207,9 @@ mermaid::mermaid.txt["foobaz"]
|
|
207
207
|
eos
|
208
208
|
|
209
209
|
load_asciidoc doc
|
210
|
-
expect(File.
|
211
|
-
expect(File.
|
212
|
-
expect(File.
|
210
|
+
expect(File.exist?('foobar.png')).to be true
|
211
|
+
expect(File.exist?('foobaz.png')).to be true
|
212
|
+
expect(File.exist?('mermaid.png')).to be false
|
213
213
|
end
|
214
214
|
|
215
215
|
it "should respect the sequenceConfig attribute" do
|
@@ -245,8 +245,8 @@ mermaid::mermaid.txt["without_config"]
|
|
245
245
|
eos
|
246
246
|
|
247
247
|
load_asciidoc doc
|
248
|
-
expect(File.
|
249
|
-
expect(File.
|
248
|
+
expect(File.exist?('with_config.png')).to be true
|
249
|
+
expect(File.exist?('without_config.png')).to be true
|
250
250
|
expect(File.size('with_config.png')).to_not be File.size('without_config.png')
|
251
251
|
end
|
252
252
|
|
@@ -270,8 +270,8 @@ mermaid::mermaid.txt["without_width"]
|
|
270
270
|
eos
|
271
271
|
|
272
272
|
load_asciidoc doc
|
273
|
-
expect(File.
|
274
|
-
expect(File.
|
273
|
+
expect(File.exist?('with_width.png')).to be true
|
274
|
+
expect(File.exist?('without_width.png')).to be true
|
275
275
|
expect(File.size('with_width.png')).to_not be File.size('without_width.png')
|
276
276
|
end
|
277
277
|
end
|
data/spec/plantuml_spec.rb
CHANGED
@@ -23,14 +23,50 @@ plantuml::plantuml.txt[format="png"]
|
|
23
23
|
d = load_asciidoc doc
|
24
24
|
expect(d).to_not be_nil
|
25
25
|
|
26
|
-
b = d.find { |
|
26
|
+
b = d.find { |bl| bl.context == :image }
|
27
27
|
expect(b).to_not be_nil
|
28
28
|
|
29
29
|
expect(b.content_model).to eq :empty
|
30
30
|
|
31
31
|
target = b.attributes['target']
|
32
32
|
expect(target).to_not be_nil
|
33
|
-
expect(target).to match
|
33
|
+
expect(target).to match(/\.png$/)
|
34
|
+
expect(File.exist?(target)).to be true
|
35
|
+
|
36
|
+
expect(b.attributes['width']).to_not be_nil
|
37
|
+
expect(b.attributes['height']).to_not be_nil
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should generate PNG images when format is set to 'png'" do
|
41
|
+
code = <<-eos
|
42
|
+
User -> (Start)
|
43
|
+
User --> (Use the application) : Label
|
44
|
+
|
45
|
+
:Main Admin: ---> (Use the application) : Another label
|
46
|
+
eos
|
47
|
+
|
48
|
+
File.write('plantuml.txt', code)
|
49
|
+
|
50
|
+
doc = <<-eos
|
51
|
+
= Hello, PlantUML!
|
52
|
+
Doc Writer <doc@example.com>
|
53
|
+
|
54
|
+
== First Section
|
55
|
+
|
56
|
+
plantuml::plantuml.txt[format="png"]
|
57
|
+
eos
|
58
|
+
|
59
|
+
d = load_asciidoc doc
|
60
|
+
expect(d).to_not be_nil
|
61
|
+
|
62
|
+
b = d.find { |bl| bl.context == :image }
|
63
|
+
expect(b).to_not be_nil
|
64
|
+
|
65
|
+
expect(b.content_model).to eq :empty
|
66
|
+
|
67
|
+
target = b.attributes['target']
|
68
|
+
expect(target).to_not be_nil
|
69
|
+
expect(target).to match(/\.png$/)
|
34
70
|
expect(File.exists?(target)).to be true
|
35
71
|
|
36
72
|
expect(b.attributes['width']).to_not be_nil
|
@@ -60,11 +96,11 @@ plantuml::plantuml.txt[format="svg", subs=attributes+]
|
|
60
96
|
d = load_asciidoc doc, :attributes => {'backend' => 'html5'}
|
61
97
|
expect(d).to_not be_nil
|
62
98
|
|
63
|
-
b = d.find { |
|
99
|
+
b = d.find { |bl| bl.context == :image }
|
64
100
|
expect(b).to_not be_nil
|
65
101
|
|
66
102
|
target = b.attributes['target']
|
67
|
-
expect(File.
|
103
|
+
expect(File.exist?(target)).to be true
|
68
104
|
|
69
105
|
content = File.read(target)
|
70
106
|
expect(content).to include('ParentClass')
|
@@ -124,15 +160,15 @@ User --> (Use the application) : Label
|
|
124
160
|
d = load_asciidoc doc
|
125
161
|
expect(d).to_not be_nil
|
126
162
|
|
127
|
-
b = d.find { |
|
163
|
+
b = d.find { |bl| bl.context == :image }
|
128
164
|
expect(b).to_not be_nil
|
129
165
|
|
130
166
|
expect(b.content_model).to eq :empty
|
131
167
|
|
132
168
|
target = b.attributes['target']
|
133
169
|
expect(target).to_not be_nil
|
134
|
-
expect(target).to match
|
135
|
-
expect(File.
|
170
|
+
expect(target).to match(/\.png$/)
|
171
|
+
expect(File.exist?(target)).to be true
|
136
172
|
|
137
173
|
expect(b.attributes['width']).to_not be_nil
|
138
174
|
expect(b.attributes['height']).to_not be_nil
|
@@ -157,15 +193,15 @@ User --> (Use the application) : Label
|
|
157
193
|
d = load_asciidoc doc
|
158
194
|
expect(d).to_not be_nil
|
159
195
|
|
160
|
-
b = d.find { |
|
196
|
+
b = d.find { |bl| bl.context == :image }
|
161
197
|
expect(b).to_not be_nil
|
162
198
|
|
163
199
|
expect(b.content_model).to eq :empty
|
164
200
|
|
165
201
|
target = b.attributes['target']
|
166
202
|
expect(target).to_not be_nil
|
167
|
-
expect(target).to match
|
168
|
-
expect(File.
|
203
|
+
expect(target).to match(/\.svg/)
|
204
|
+
expect(File.exist?(target)).to be true
|
169
205
|
|
170
206
|
expect(b.attributes['width']).to_not be_nil
|
171
207
|
expect(b.attributes['height']).to_not be_nil
|
@@ -190,7 +226,7 @@ User --> (Use the application) : Label
|
|
190
226
|
d = load_asciidoc doc
|
191
227
|
expect(d).to_not be_nil
|
192
228
|
|
193
|
-
b = d.find { |
|
229
|
+
b = d.find { |bl| bl.context == :literal }
|
194
230
|
expect(b).to_not be_nil
|
195
231
|
|
196
232
|
expect(b.content_model).to eq :verbatim
|
@@ -210,7 +246,7 @@ Doc Writer <doc@example.com>
|
|
210
246
|
----
|
211
247
|
eos
|
212
248
|
|
213
|
-
expect { load_asciidoc doc }.to raise_error
|
249
|
+
expect { load_asciidoc doc }.to raise_error(/support.*format/i)
|
214
250
|
end
|
215
251
|
|
216
252
|
it 'should use plantuml configuration when specified as a document attribute' do
|
@@ -238,14 +274,14 @@ ArrowColor #DEADBE
|
|
238
274
|
end
|
239
275
|
|
240
276
|
d = load_asciidoc doc
|
241
|
-
b = d.find { |
|
277
|
+
b = d.find { |bl| bl.context == :image }
|
242
278
|
|
243
279
|
target = b.attributes['target']
|
244
280
|
expect(target).to_not be_nil
|
245
|
-
expect(File.
|
281
|
+
expect(File.exist?(target)).to be true
|
246
282
|
|
247
283
|
svg = File.read(target)
|
248
|
-
expect(svg).to match
|
284
|
+
expect(svg).to match(/<path.*fill="#DEADBE"/)
|
249
285
|
end
|
250
286
|
|
251
287
|
it 'should not regenerate images when source has not changed' do
|
@@ -275,7 +311,7 @@ Foo1 -> Foo2 : To boundary
|
|
275
311
|
eos
|
276
312
|
|
277
313
|
d = load_asciidoc doc
|
278
|
-
b = d.find { |
|
314
|
+
b = d.find { |bl| bl.context == :image }
|
279
315
|
target = b.attributes['target']
|
280
316
|
mtime1 = File.mtime(target)
|
281
317
|
|
@@ -309,7 +345,7 @@ plantuml::plantuml.txt[]
|
|
309
345
|
eos
|
310
346
|
|
311
347
|
load_asciidoc doc
|
312
|
-
expect(File.
|
348
|
+
expect(File.exist?('plantuml.png')).to be true
|
313
349
|
end
|
314
350
|
|
315
351
|
it 'should respect target attribute in block macros' do
|
@@ -333,9 +369,9 @@ plantuml::plantuml.txt["foobaz"]
|
|
333
369
|
eos
|
334
370
|
|
335
371
|
load_asciidoc doc
|
336
|
-
expect(File.
|
337
|
-
expect(File.
|
338
|
-
expect(File.
|
372
|
+
expect(File.exist?('foobar.png')).to be true
|
373
|
+
expect(File.exist?('foobaz.png')).to be true
|
374
|
+
expect(File.exist?('plantuml.png')).to be false
|
339
375
|
end
|
340
376
|
|
341
377
|
it 'should respect target attribute values with relative paths in block macros' do
|
@@ -359,9 +395,9 @@ plantuml::plantuml.txt["test2/foobaz"]
|
|
359
395
|
eos
|
360
396
|
|
361
397
|
load_asciidoc doc
|
362
|
-
expect(File.
|
363
|
-
expect(File.
|
364
|
-
expect(File.
|
398
|
+
expect(File.exist?('test/foobar.png')).to be true
|
399
|
+
expect(File.exist?('test2/foobaz.png')).to be true
|
400
|
+
expect(File.exist?('plantuml.png')).to be false
|
365
401
|
end
|
366
402
|
|
367
403
|
it 'should write files to outdir if set' do
|
@@ -380,12 +416,12 @@ Foo1 -> Foo2 : To boundary
|
|
380
416
|
eos
|
381
417
|
|
382
418
|
d = load_asciidoc doc, {:attributes => {'outdir' => 'foo'}}
|
383
|
-
b = d.find { |
|
419
|
+
b = d.find { |bl| bl.context == :image }
|
384
420
|
|
385
421
|
target = b.attributes['target']
|
386
422
|
expect(target).to_not be_nil
|
387
|
-
expect(File.
|
388
|
-
expect(File.
|
423
|
+
expect(File.exist?(target)).to be false
|
424
|
+
expect(File.exist?(File.expand_path(target, 'foo'))).to be true
|
389
425
|
end
|
390
426
|
|
391
427
|
it 'should write files to imagesoutdir if set' do
|
@@ -404,13 +440,13 @@ Foo1 -> Foo2 : To boundary
|
|
404
440
|
eos
|
405
441
|
|
406
442
|
d = load_asciidoc doc, {:attributes => {'imagesoutdir' => 'bar', 'outdir' => 'foo'}}
|
407
|
-
b = d.find { |
|
443
|
+
b = d.find { |bl| bl.context == :image }
|
408
444
|
|
409
445
|
target = b.attributes['target']
|
410
446
|
expect(target).to_not be_nil
|
411
|
-
expect(File.
|
412
|
-
expect(File.
|
413
|
-
expect(File.
|
447
|
+
expect(File.exist?(target)).to be false
|
448
|
+
expect(File.exist?(File.expand_path(target, 'bar'))).to be true
|
449
|
+
expect(File.exist?(File.expand_path(target, 'foo'))).to be false
|
414
450
|
end
|
415
451
|
|
416
452
|
it 'should omit width/height attributes when generating docbook' do
|
@@ -429,11 +465,11 @@ User -> (Start)
|
|
429
465
|
d = load_asciidoc doc, :attributes => {'backend' => 'docbook5'}
|
430
466
|
expect(d).to_not be_nil
|
431
467
|
|
432
|
-
b = d.find { |
|
468
|
+
b = d.find { |bl| bl.context == :image }
|
433
469
|
expect(b).to_not be_nil
|
434
470
|
|
435
471
|
target = b.attributes['target']
|
436
|
-
expect(File.
|
472
|
+
expect(File.exist?(target)).to be true
|
437
473
|
|
438
474
|
expect(b.attributes['width']).to be_nil
|
439
475
|
expect(b.attributes['height']).to be_nil
|
@@ -464,11 +500,11 @@ Doc Writer <doc@example.com>
|
|
464
500
|
d = load_asciidoc doc, :attributes => {'backend' => 'docbook5'}
|
465
501
|
expect(d).to_not be_nil
|
466
502
|
|
467
|
-
b = d.find { |
|
503
|
+
b = d.find { |bl| bl.context == :image }
|
468
504
|
expect(b).to_not be_nil
|
469
505
|
|
470
506
|
target = b.attributes['target']
|
471
|
-
expect(File.
|
507
|
+
expect(File.exist?(target)).to be true
|
472
508
|
|
473
509
|
expect(b.attributes['width']).to be_nil
|
474
510
|
expect(b.attributes['height']).to be_nil
|
@@ -500,11 +536,11 @@ salt
|
|
500
536
|
d = load_asciidoc doc, :attributes => {'backend' => 'docbook5'}
|
501
537
|
expect(d).to_not be_nil
|
502
538
|
|
503
|
-
b = d.find { |
|
539
|
+
b = d.find { |bl| bl.context == :image }
|
504
540
|
expect(b).to_not be_nil
|
505
541
|
|
506
542
|
target = b.attributes['target']
|
507
|
-
expect(File.
|
543
|
+
expect(File.exist?(target)).to be true
|
508
544
|
|
509
545
|
expect(b.attributes['width']).to be_nil
|
510
546
|
expect(b.attributes['height']).to be_nil
|
@@ -532,11 +568,11 @@ salt
|
|
532
568
|
d = load_asciidoc doc, :attributes => {'backend' => 'docbook5'}
|
533
569
|
expect(d).to_not be_nil
|
534
570
|
|
535
|
-
b = d.find { |
|
571
|
+
b = d.find { |bl| bl.context == :image }
|
536
572
|
expect(b).to_not be_nil
|
537
573
|
|
538
574
|
target = b.attributes['target']
|
539
|
-
expect(File.
|
575
|
+
expect(File.exist?(target)).to be true
|
540
576
|
|
541
577
|
expect(b.attributes['width']).to be_nil
|
542
578
|
expect(b.attributes['height']).to be_nil
|
@@ -568,10 +604,10 @@ A -> B
|
|
568
604
|
eos
|
569
605
|
|
570
606
|
d = load_asciidoc doc, :attributes => {'backend' => 'html5'}
|
571
|
-
unscaled_image = d.find { |
|
607
|
+
unscaled_image = d.find { |bl| bl.context == :image }
|
572
608
|
|
573
609
|
d = load_asciidoc scaled_doc, :attributes => {'backend' => 'html5'}
|
574
|
-
scaled_image = d.find { |
|
610
|
+
scaled_image = d.find { |bl| bl.context == :image }
|
575
611
|
|
576
612
|
expect(scaled_image.attributes['width']).to be_within(1).of(unscaled_image.attributes['width'] * 1.5)
|
577
613
|
expect(scaled_image.attributes['height']).to be_within(1).of(unscaled_image.attributes['height'] * 1.5)
|
@@ -649,11 +685,11 @@ class {child-class}
|
|
649
685
|
d = load_asciidoc doc, :attributes => {'backend' => 'html5'}
|
650
686
|
expect(d).to_not be_nil
|
651
687
|
|
652
|
-
b = d.find { |
|
688
|
+
b = d.find { |bl| bl.context == :image }
|
653
689
|
expect(b).to_not be_nil
|
654
690
|
|
655
691
|
target = b.attributes['target']
|
656
|
-
expect(File.
|
692
|
+
expect(File.exist?(target)).to be true
|
657
693
|
|
658
694
|
content = File.read(target)
|
659
695
|
expect(content).to include('ParentClass')
|