|
55 | 55 | DOCBOOK
|
56 | 56 | expect(actual).to eq(expected.strip)
|
57 | 57 | end
|
| 58 | + |
| 59 | + it "doesn't mind skipped #{name} block macros" do |
| 60 | + actual = convert <<~ASCIIDOC |
| 61 | + == Example |
| 62 | +
|
| 63 | + ifeval::["true" == "false"] |
| 64 | + #{name}[some_version] |
| 65 | + #endif::[] |
| 66 | + ASCIIDOC |
| 67 | + expected = <<~DOCBOOK |
| 68 | + <chapter id="_example"> |
| 69 | + <title>Example</title> |
| 70 | +
|
| 71 | + </chapter> |
| 72 | + DOCBOOK |
| 73 | + expect(actual).to eq(expected.strip) |
| 74 | + end |
58 | 75 | end
|
59 | 76 |
|
60 | 77 | it "invokes include-tagged::" do
|
|
210 | 227 | expect(actual).to eq(expected.strip)
|
211 | 228 | end
|
212 | 229 |
|
| 230 | + it "doesn't mind skipped source blocks that are missing callouts" do |
| 231 | + actual = convert <<~ASCIIDOC |
| 232 | + == Example |
| 233 | +
|
| 234 | + ifeval::["true" == "false"] |
| 235 | + ["source","sh",subs="attributes"] |
| 236 | + -------------------------------------------- |
| 237 | + wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip |
| 238 | + wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-{version}.zip.sha512 |
| 239 | + shasum -a 512 -c elasticsearch-{version}.zip.sha512 <1> |
| 240 | + unzip elasticsearch-{version}.zip |
| 241 | + cd elasticsearch-{version}/ <2> |
| 242 | + -------------------------------------------- |
| 243 | + <1> Compares the SHA of the downloaded `.zip` archive and the published checksum, which should output |
| 244 | + `elasticsearch-{version}.zip: OK`. |
| 245 | + <2> This directory is known as `$ES_HOME`. |
| 246 | + endif::[] |
| 247 | + ASCIIDOC |
| 248 | + expected = <<~DOCBOOK |
| 249 | + <chapter id="_example"> |
| 250 | + <title>Example</title> |
| 251 | +
|
| 252 | + </chapter> |
| 253 | + DOCBOOK |
| 254 | + expect(actual).to eq(expected.strip) |
| 255 | + end |
| 256 | + |
213 | 257 | it "fixes mismatched fencing on code blocks" do
|
214 | 258 | input = <<~ASCIIDOC
|
215 | 259 | == Example
|
|
227 | 271 | expect(actual).to eq(expected.strip)
|
228 | 272 | end
|
229 | 273 |
|
| 274 | + it "doesn't doesn't mind skipped mismatched code blocks" do |
| 275 | + actual = convert <<~ASCIIDOC |
| 276 | + == Example |
| 277 | +
|
| 278 | + ifeval::["true" == "false"] |
| 279 | + ---- |
| 280 | + foo |
| 281 | + -------- |
| 282 | + endif::[] |
| 283 | + ASCIIDOC |
| 284 | + expected = <<~DOCBOOK |
| 285 | + <chapter id="_example"> |
| 286 | + <title>Example</title> |
| 287 | +
|
| 288 | + </chapter> |
| 289 | + DOCBOOK |
| 290 | + expect(actual).to eq(expected.strip) |
| 291 | + end |
| 292 | + |
230 | 293 | it "doesn't break table-style outputs" do
|
231 | 294 | actual = convert <<~ASCIIDOC
|
232 | 295 | == Example
|
|
0 commit comments