review 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +11 -1
  3. data/.travis.yml +16 -15
  4. data/NEWS.ja.md +75 -0
  5. data/NEWS.md +75 -0
  6. data/appveyor.yml +20 -2
  7. data/bin/review-catalog-converter +3 -3
  8. data/bin/review-check +3 -3
  9. data/bin/review-compile +6 -6
  10. data/bin/review-epubmaker +3 -35
  11. data/bin/review-index +5 -5
  12. data/bin/review-preproc +4 -4
  13. data/bin/review-vol +5 -5
  14. data/doc/format.ja.md +6 -4
  15. data/doc/format.md +3 -1
  16. data/lib/epubmaker/epubcommon.rb +1 -2
  17. data/lib/epubmaker/epubv2.rb +1 -1
  18. data/lib/epubmaker/epubv3.rb +1 -0
  19. data/lib/epubmaker/producer.rb +2 -1
  20. data/lib/review/book/base.rb +5 -5
  21. data/lib/review/book/index.rb +18 -5
  22. data/lib/review/builder.rb +8 -2
  23. data/lib/review/compiler.rb +11 -34
  24. data/lib/review/epub2html.rb +37 -4
  25. data/lib/review/epubmaker.rb +40 -3
  26. data/lib/review/htmlbuilder.rb +2 -2
  27. data/lib/review/idgxmlbuilder.rb +9 -8
  28. data/lib/review/init.rb +7 -7
  29. data/lib/review/latexbuilder.rb +36 -14
  30. data/lib/review/location.rb +32 -0
  31. data/lib/review/markdownbuilder.rb +8 -1
  32. data/lib/review/plaintextbuilder.rb +9 -9
  33. data/lib/review/preprocessor.rb +2 -24
  34. data/lib/review/topbuilder.rb +4 -4
  35. data/lib/review/update.rb +3 -3
  36. data/lib/review/version.rb +1 -1
  37. data/lib/review/yamlloader.rb +23 -16
  38. data/review.gemspec +3 -2
  39. data/templates/latex/config.erb +4 -0
  40. data/templates/latex/review-jlreq/review-base.sty +45 -22
  41. data/templates/latex/review-jsbook/review-base.sty +20 -15
  42. data/templates/latex/review-jsbook/review-jsbook.cls +3 -3
  43. data/templates/opf/epubv3.opf.erb +1 -0
  44. data/test/assets/test_template.tex +4 -0
  45. data/test/assets/test_template_backmatter.tex +4 -0
  46. data/test/test_book.rb +1 -1
  47. data/test/test_builder.rb +16 -0
  48. data/test/test_catalog.rb +5 -0
  49. data/test/test_htmlbuilder.rb +471 -96
  50. data/test/test_idgxmlbuilder.rb +132 -17
  51. data/test/test_index.rb +40 -0
  52. data/test/test_latexbuilder.rb +668 -72
  53. data/test/test_latexbuilder_v2.rb +597 -68
  54. data/test/test_markdownbuilder.rb +90 -13
  55. data/test/test_md2inaobuilder.rb +20 -7
  56. data/test/test_plaintextbuilder.rb +241 -19
  57. data/test/test_preprocessor.rb +2 -16
  58. data/test/test_rstbuilder.rb +216 -22
  59. data/test/test_topbuilder.rb +334 -22
  60. metadata +20 -6
@@ -29,34 +29,62 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
29
29
 
30
30
  def test_headline_level1
31
31
  actual = compile_block("={test} this is test.\n")
32
- assert_equal %Q(\\chapter{this is test.}\n\\label{chap:chap1}\n), actual
32
+ expected = <<-EOS
33
+ \\chapter{this is test.}
34
+ \\label{chap:chap1}
35
+ EOS
36
+ assert_equal expected, actual
33
37
  end
34
38
 
35
39
  def test_headline_level1_without_secno
36
40
  @config['secnolevel'] = 0
37
41
  actual = compile_block("={test} this is test.\n")
38
- assert_equal %Q(\\chapter*{this is test.}\n\\addcontentsline{toc}{chapter}{this is test.}\n\\label{chap:chap1}\n), actual
42
+ expected = <<-EOS
43
+ \\chapter*{this is test.}
44
+ \\addcontentsline{toc}{chapter}{this is test.}
45
+ \\label{chap:chap1}
46
+ EOS
47
+ assert_equal expected, actual
39
48
  end
40
49
 
41
50
  def test_headline_level1_with_inlinetag
42
51
  actual = compile_block(%Q(={test} this @<b>{is} test.<&"_>\n))
43
- assert_equal %Q(\\chapter{this \\textbf{is} test.\\textless{}\\&"\\textunderscore{}\\textgreater{}}\n\\label{chap:chap1}\n), actual
52
+ expected = <<-EOS
53
+ \\chapter{this \\textbf{is} test.\\textless{}\\&"\\textunderscore{}\\textgreater{}}
54
+ \\label{chap:chap1}
55
+ EOS
56
+ assert_equal expected, actual
44
57
  end
45
58
 
46
59
  def test_headline_level2
47
60
  actual = compile_block("=={test} this is test.\n")
48
- assert_equal %Q(\\section{this is test.}\n\\label{sec:1-1}\n\\label{test}\n), actual
61
+ expected = <<-EOS
62
+ \\section{this is test.}
63
+ \\label{sec:1-1}
64
+ \\label{test}
65
+ EOS
66
+ assert_equal expected, actual
49
67
  end
50
68
 
51
69
  def test_headline_level3
52
70
  actual = compile_block("==={test} this is test.\n")
53
- assert_equal %Q(\\subsection*{this is test.}\n\\label{sec:1-0-1}\n\\label{test}\n), actual
71
+ expected = <<-EOS
72
+ \\subsection*{this is test.}
73
+ \\label{sec:1-0-1}
74
+ \\label{test}
75
+ EOS
76
+ assert_equal expected, actual
54
77
  end
55
78
 
56
79
  def test_headline_level3_with_secno
57
80
  @config['secnolevel'] = 3
58
81
  actual = compile_block("==={test} this is test.\n")
59
- assert_equal %Q(\\subsection{this is test.}\n\\label{sec:1-0-1}\n\\label{test}\n), actual
82
+ expected = <<-EOS
83
+ \\subsection{this is test.}
84
+ \\label{sec:1-0-1}
85
+ \\label{test}
86
+ EOS
87
+ assert_equal expected, actual
60
88
  end
61
89
 
62
90
  def test_label
@@ -249,46 +277,131 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
249
277
 
250
278
  def test_dlist
251
279
  actual = compile_block(": foo\n foo.\n bar.\n")
252
- assert_equal %Q(\n\\begin{description}\n\\item[foo] \\mbox{} \\\\\nfoo.bar.\n\\end{description}\n), actual
280
+ expected = <<-EOS
281
+
282
+ \\begin{description}
283
+ \\item[foo] \\mbox{} \\\\
284
+ foo.
285
+ bar.
286
+ \\end{description}
287
+ EOS
288
+ assert_equal expected, actual
253
289
  end
254
290
 
255
291
  def test_dlist_with_bracket
256
292
  actual = compile_block(": foo[bar]\n foo.\n bar.\n")
257
- assert_equal %Q(\n\\begin{description}\n\\item[foo\\lbrack{}bar\\rbrack{}] \\mbox{} \\\\\nfoo.bar.\n\\end{description}\n), actual
293
+ expected = <<-EOS
294
+
295
+ \\begin{description}
296
+ \\item[foo\\lbrack{}bar\\rbrack{}] \\mbox{} \\\\
297
+ foo.
298
+ bar.
299
+ \\end{description}
300
+ EOS
301
+ assert_equal expected, actual
258
302
  end
259
303
 
260
304
  def test_dlist_beforeulol
261
305
  actual = compile_block(" : foo\n foo.\n\npara\n\n : foo\n foo.\n\n 1. bar\n\n : foo\n foo.\n\n * bar\n")
262
- assert_equal %Q(\n\\begin{description}\n\\item[foo] \\mbox{} \\\\\nfoo.\n\\end{description}\n\npara\n\n\\begin{description}\n\\item[foo] \\mbox{} \\\\\nfoo.\n\\end{description}\n\n\\begin{enumerate}\n\\item bar\n\\end{enumerate}\n\n\\begin{description}\n\\item[foo] \\mbox{} \\\\\nfoo.\n\\end{description}\n\n\\begin{itemize}\n\\item bar\n\\end{itemize}\n), actual
306
+ expected = <<-EOS
307
+
308
+ \\begin{description}
309
+ \\item[foo] \\mbox{} \\\\
310
+ foo.
311
+ \\end{description}
312
+
313
+ para
314
+
315
+ \\begin{description}
316
+ \\item[foo] \\mbox{} \\\\
317
+ foo.
318
+ \\end{description}
319
+
320
+ \\begin{enumerate}
321
+ \\item bar
322
+ \\end{enumerate}
323
+
324
+ \\begin{description}
325
+ \\item[foo] \\mbox{} \\\\
326
+ foo.
327
+ \\end{description}
328
+
329
+ \\begin{itemize}
330
+ \\item bar
331
+ \\end{itemize}
332
+ EOS
333
+ assert_equal expected, actual
263
334
  end
264
335
 
265
336
  def test_cmd
266
337
  actual = compile_block("//cmd{\nfoo\nbar\n\nbuz\n//}\n")
267
- assert_equal %Q(\n\\begin{reviewcmd}\nfoo\nbar\n\nbuz\n\\end{reviewcmd}\n), actual
338
+ expected = <<-EOS
339
+
340
+ \\begin{reviewcmd}
341
+ foo
342
+ bar
343
+
344
+ buz
345
+ \\end{reviewcmd}
346
+ EOS
347
+ assert_equal expected, actual
268
348
  end
269
349
 
270
350
  def test_cmd_caption
271
351
  actual = compile_block("//cmd[cap1]{\nfoo\nbar\n\nbuz\n//}\n")
272
- assert_equal %Q(\n\\reviewcmdcaption{cap1}\n\\begin{reviewcmd}\nfoo\nbar\n\nbuz\n\\end{reviewcmd}\n), actual
352
+ expected = <<-EOS
353
+
354
+ \\reviewcmdcaption{cap1}
355
+ \\begin{reviewcmd}
356
+ foo
357
+ bar
358
+
359
+ buz
360
+ \\end{reviewcmd}
361
+ EOS
362
+ assert_equal expected, actual
273
363
  end
274
364
 
275
365
  def test_cmd_lst
276
366
  @book.config['highlight'] = {}
277
367
  @book.config['highlight']['latex'] = 'listings'
278
368
  actual = compile_block("//cmd{\nfoo\nbar\n\nbuz\n//}\n")
279
- assert_equal %Q(\\vspace{-1.5em}\\begin{reviewcmdlst}[title={\\relax},language={}]\nfoo\nbar\n\nbuz\n\\end{reviewcmdlst}\n), actual
369
+ expected = <<-EOS
370
+ \\vspace{-1.5em}\\begin{reviewcmdlst}[title={\\relax},language={}]
371
+ foo
372
+ bar
373
+
374
+ buz
375
+ \\end{reviewcmdlst}
376
+ EOS
377
+ assert_equal expected, actual
280
378
  end
281
379
 
282
380
  def test_emlist
283
381
  actual = compile_block("//emlist{\nfoo\nbar\n\nbuz\n//}\n")
284
- assert_equal %Q(\n\\begin{reviewemlist}\nfoo\nbar\n\nbuz\n\\end{reviewemlist}\n), actual
382
+ expected = <<-EOS
383
+
384
+ \\begin{reviewemlist}
385
+ foo
386
+ bar
387
+
388
+ buz
389
+ \\end{reviewemlist}
390
+ EOS
391
+ assert_equal expected, actual
285
392
  end
286
393
 
287
394
  def test_emlist_lst
288
395
  @book.config['highlight'] = {}
289
396
  @book.config['highlight']['latex'] = 'listings'
290
397
  actual = compile_block("//emlist[][sql]{\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n//}\n")
291
- assert_equal %Q(\n\\vspace{-1.5em}\\begin{reviewemlistlst}[title={\\relax},language={sql}]\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n\\end{reviewemlistlst}\n), actual
398
+ expected = <<-EOS
399
+
400
+ \\vspace{-1.5em}\\begin{reviewemlistlst}[title={\\relax},language={sql}]
401
+ SELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'
402
+ \\end{reviewemlistlst}
403
+ EOS
404
+ assert_equal expected, actual
292
405
  end
293
406
 
294
407
  def test_emlist_lst_without_lang
@@ -296,45 +409,112 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
296
409
  @book.config['highlight']['latex'] = 'listings'
297
410
  @book.config['highlight']['lang'] = 'sql'
298
411
  actual = compile_block("//emlist[]{\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n//}\n")
299
- assert_equal %Q(\n\\vspace{-1.5em}\\begin{reviewemlistlst}[title={\\relax},language={sql}]\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n\\end{reviewemlistlst}\n), actual
412
+ expected = <<-EOS
413
+
414
+ \\vspace{-1.5em}\\begin{reviewemlistlst}[title={\\relax},language={sql}]
415
+ SELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'
416
+ \\end{reviewemlistlst}
417
+ EOS
418
+ assert_equal expected, actual
300
419
  end
301
420
 
302
421
  def test_emlist_caption
303
422
  actual = compile_block("//emlist[cap1]{\nfoo\nbar\n\nbuz\n//}\n")
304
- assert_equal %Q(\n\\reviewemlistcaption{cap1}\n\\begin{reviewemlist}\nfoo\nbar\n\nbuz\n\\end{reviewemlist}\n), actual
423
+ expected = <<-EOS
424
+
425
+ \\reviewemlistcaption{cap1}
426
+ \\begin{reviewemlist}
427
+ foo
428
+ bar
429
+
430
+ buz
431
+ \\end{reviewemlist}
432
+ EOS
433
+ assert_equal expected, actual
305
434
  end
306
435
 
307
436
  def test_emlist_empty_caption
308
437
  actual = compile_block("//emlist[]{\nfoo\nbar\n\nbuz\n//}\n")
309
- assert_equal %Q(\n\\begin{reviewemlist}\nfoo\nbar\n\nbuz\n\\end{reviewemlist}\n), actual
438
+ expected = <<-EOS
439
+
440
+ \\begin{reviewemlist}
441
+ foo
442
+ bar
443
+
444
+ buz
445
+ \\end{reviewemlist}
446
+ EOS
447
+ assert_equal expected, actual
310
448
  end
311
449
 
312
450
  def test_emlist_with_tab
313
451
  actual = compile_block("//emlist{\n\tfoo\n\t\tbar\n\n\tbuz\n//}\n")
314
- assert_equal %Q(\n\\begin{reviewemlist}\n foo\n bar\n\n buz\n\\end{reviewemlist}\n), actual
452
+ expected = <<-EOS
453
+
454
+ \\begin{reviewemlist}
455
+ foo
456
+ bar
457
+
458
+ buz
459
+ \\end{reviewemlist}
460
+ EOS
461
+ assert_equal expected, actual
315
462
  end
316
463
 
317
464
  def test_emlist_with_tab4
318
465
  @config['tabwidth'] = 4
319
466
  actual = compile_block("//emlist{\n\tfoo\n\t\tbar\n\n\tbuz\n//}\n")
320
- assert_equal %Q(\n\\begin{reviewemlist}\n foo\n bar\n\n buz\n\\end{reviewemlist}\n), actual
467
+ expected = <<-EOS
468
+
469
+ \\begin{reviewemlist}
470
+ foo
471
+ bar
472
+
473
+ buz
474
+ \\end{reviewemlist}
475
+ EOS
476
+ assert_equal expected, actual
321
477
  end
322
478
 
323
479
  def test_emlistnum_caption
324
480
  actual = compile_block("//emlistnum[cap1]{\nfoo\nbar\n\nbuz\n//}\n")
325
- assert_equal %Q(\n\\reviewemlistcaption{cap1}\n\\begin{reviewemlist}\n 1: foo\n 2: bar\n 3: \n 4: buz\n\\end{reviewemlist}\n), actual
481
+ expected = <<-EOS
482
+
483
+ \\reviewemlistcaption{cap1}
484
+ \\begin{reviewemlist}
485
+ 1: foo
486
+ 2: bar
487
+ 3:
488
+ 4: buz
489
+ \\end{reviewemlist}
490
+ EOS
491
+ assert_equal expected, actual
326
492
  end
327
493
 
328
494
  def test_list
329
495
  actual = compile_block("//list[id1][cap1]{\nfoo\nbar\n\nbuz\n//}\n")
330
- assert_equal %Q(\\reviewlistcaption{リスト1.1: cap1}\n\\begin{reviewlist}\nfoo\nbar\n\nbuz\n\\end{reviewlist}\n), actual
496
+ expected = <<-EOS
497
+ \\reviewlistcaption{リスト1.1: cap1}
498
+ \\begin{reviewlist}
499
+ foo
500
+ bar
501
+
502
+ buz
503
+ \\end{reviewlist}
504
+ EOS
505
+ assert_equal expected, actual
331
506
  end
332
507
 
333
508
  def test_list_lst
334
509
  @book.config['highlight'] = {}
335
510
  @book.config['highlight']['latex'] = 'listings'
336
511
  actual = compile_block("//list[id1][cap1][sql]{\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n//}\n")
337
- assert_equal %Q(\\begin{reviewlistlst}[caption={cap1},language={sql}]\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n\\end{reviewlistlst}\n), actual
512
+ expected = <<-EOS
513
+ \\begin{reviewlistlst}[caption={cap1},language={sql}]
514
+ SELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'
515
+ \\end{reviewlistlst}
516
+ EOS
517
+ assert_equal expected, actual
338
518
  end
339
519
 
340
520
  def test_list_lst_with_lang
@@ -342,78 +522,199 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
342
522
  @book.config['highlight']['latex'] = 'listings'
343
523
  @book.config['highlight']['lang'] = 'sql'
344
524
  actual = compile_block("//list[id1][cap1]{\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n//}\n")
345
- assert_equal %Q(\\begin{reviewlistlst}[caption={cap1},language={sql}]\nSELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'\n\\end{reviewlistlst}\n), actual
525
+ expected = <<-EOS
526
+ \\begin{reviewlistlst}[caption={cap1},language={sql}]
527
+ SELECT COUNT(*) FROM tests WHERE tests.no > 10 AND test.name LIKE 'ABC%'
528
+ \\end{reviewlistlst}
529
+ EOS
530
+ assert_equal expected, actual
346
531
  end
347
532
 
348
533
  def test_listnum
349
534
  actual = compile_block("//listnum[test1][ruby]{\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n//}\n")
350
- assert_equal %Q(\\reviewlistcaption{リスト1.1: ruby}\n\\begin{reviewlist}\n 1: class Foo\n 2: def foo\n 3: bar\n 4: \n 5: buz\n 6: end\n 7: end\n\\end{reviewlist}\n), actual
535
+ expected = <<-EOS
536
+ \\reviewlistcaption{リスト1.1: ruby}
537
+ \\begin{reviewlist}
538
+ 1: class Foo
539
+ 2: def foo
540
+ 3: bar
541
+ 4:
542
+ 5: buz
543
+ 6: end
544
+ 7: end
545
+ \\end{reviewlist}
546
+ EOS
547
+ assert_equal expected, actual
351
548
  end
352
549
 
353
550
  def test_listnum_linenum
354
551
  actual = compile_block("//firstlinenum[100]\n//listnum[test1][ruby]{\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n//}\n")
355
- assert_equal %Q(\\reviewlistcaption{リスト1.1: ruby}\n\\begin{reviewlist}\n100: class Foo\n101: def foo\n102: bar\n103: \n104: buz\n105: end\n106: end\n\\end{reviewlist}\n), actual
552
+ expected = <<-EOS
553
+ \\reviewlistcaption{リスト1.1: ruby}
554
+ \\begin{reviewlist}
555
+ 100: class Foo
556
+ 101: def foo
557
+ 102: bar
558
+ 103:
559
+ 104: buz
560
+ 105: end
561
+ 106: end
562
+ \\end{reviewlist}
563
+ EOS
564
+ assert_equal expected, actual
356
565
  end
357
566
 
358
567
  def test_listnum_lst
359
568
  @book.config['highlight'] = {}
360
569
  @book.config['highlight']['latex'] = 'listings'
361
570
  actual = compile_block("//listnum[test1][ruby]{\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n//}\n")
362
- assert_equal %Q(\\begin{reviewlistnumlst}[caption={ruby},language={}]\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n\\end{reviewlistnumlst}\n), actual
571
+ expected = <<-EOS
572
+ \\begin{reviewlistnumlst}[caption={ruby},language={}]
573
+ class Foo
574
+ def foo
575
+ bar
576
+
577
+ buz
578
+ end
579
+ end
580
+ \\end{reviewlistnumlst}
581
+ EOS
582
+ assert_equal expected, actual
363
583
  end
364
584
 
365
585
  def test_listnum_lst_linenum
366
586
  @book.config['highlight'] = {}
367
587
  @book.config['highlight']['latex'] = 'listings'
368
588
  actual = compile_block("//firstlinenum[100]\n//listnum[test1][ruby]{\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n//}\n")
369
- assert_equal %Q(\\begin{reviewlistnumlst}[caption={ruby},language={},firstnumber=100]\nclass Foo\n def foo\n bar\n\n buz\n end\nend\n\\end{reviewlistnumlst}\n), actual
589
+ expected = <<-EOS
590
+ \\begin{reviewlistnumlst}[caption={ruby},language={},firstnumber=100]
591
+ class Foo
592
+ def foo
593
+ bar
594
+
595
+ buz
596
+ end
597
+ end
598
+ \\end{reviewlistnumlst}
599
+ EOS
600
+ assert_equal expected, actual
370
601
  end
371
602
 
372
603
  def test_source
373
604
  actual = compile_block("//source[foo/bar/test.rb]{\nfoo\nbar\n\nbuz\n//}\n")
374
- assert_equal %Q(\\reviewsourcecaption{foo/bar/test.rb}\n\\begin{reviewsource}\nfoo\nbar\n\nbuz\n\\end{reviewsource}\n), actual
605
+ expected = <<-EOS
606
+ \\reviewsourcecaption{foo/bar/test.rb}
607
+ \\begin{reviewsource}
608
+ foo
609
+ bar
610
+
611
+ buz
612
+ \\end{reviewsource}
613
+ EOS
614
+ assert_equal expected, actual
375
615
  end
376
616
 
377
617
  def test_source_empty_caption
378
618
  actual = compile_block("//source[]{\nfoo\nbar\n\nbuz\n//}\n")
379
- assert_equal %Q(\\begin{reviewsource}\nfoo\nbar\n\nbuz\n\\end{reviewsource}\n), actual
619
+ expected = <<-EOS
620
+ \\begin{reviewsource}
621
+ foo
622
+ bar
623
+
624
+ buz
625
+ \\end{reviewsource}
626
+ EOS
627
+ assert_equal expected, actual
380
628
  end
381
629
 
382
630
  def test_source_lst
383
631
  @book.config['highlight'] = {}
384
632
  @book.config['highlight']['latex'] = 'listings'
385
633
  actual = compile_block("//source[foo/bar/test.rb]{\nfoo\nbar\n\nbuz\n//}\n")
386
- assert_equal %Q(\\begin{reviewsourcelst}[title={foo/bar/test.rb},language={}]\nfoo\nbar\n\nbuz\n\\end{reviewsourcelst}\n), actual
634
+ expected = <<-EOS
635
+ \\begin{reviewsourcelst}[title={foo/bar/test.rb},language={}]
636
+ foo
637
+ bar
638
+
639
+ buz
640
+ \\end{reviewsourcelst}
641
+ EOS
642
+ assert_equal expected, actual
387
643
  end
388
644
 
389
645
  def test_quote
390
646
  actual = compile_block("//quote{\nfoo\nbar\n\nbuz\n//}\n")
391
- assert_equal %Q(\n\\begin{quote}\nfoobar\n\nbuz\n\\end{quote}\n), actual
647
+ expected = <<-EOS
648
+
649
+ \\begin{quote}
650
+ foobar
651
+
652
+ buz
653
+ \\end{quote}
654
+ EOS
655
+ assert_equal expected, actual
392
656
  end
393
657
 
394
658
  def test_memo
395
659
  actual = compile_block("//memo[this is @<b>{test}<&>_]{\ntest1\n\ntest@<i>{2}\n//}\n")
396
- assert_equal %Q(\\begin{reviewminicolumn}\n\\reviewminicolumntitle{this is \\textbf{test}\\textless{}\\&\\textgreater{}\\textunderscore{}}\ntest1\n\ntest\\textit{2}\n\\end{reviewminicolumn}\n), actual
660
+ expected = <<-EOS
661
+ \\begin{reviewminicolumn}
662
+ \\reviewminicolumntitle{this is \\textbf{test}\\textless{}\\&\\textgreater{}\\textunderscore{}}
663
+ test1
664
+
665
+ test\\textit{2}
666
+ \\end{reviewminicolumn}
667
+ EOS
668
+ assert_equal expected, actual
397
669
  end
398
670
 
399
671
  def test_flushright
400
672
  actual = compile_block("//flushright{\nfoo\nbar\n\nbuz\n//}\n")
401
- assert_equal %Q(\n\\begin{flushright}\nfoobar\n\nbuz\n\\end{flushright}\n), actual
673
+ expected = <<-EOS
674
+
675
+ \\begin{flushright}
676
+ foobar
677
+
678
+ buz
679
+ \\end{flushright}
680
+ EOS
681
+ assert_equal expected, actual
402
682
  end
403
683
 
404
684
  def test_centering
405
685
  actual = compile_block("//centering{\nfoo\nbar\n\nbuz\n//}\n")
406
- assert_equal %Q(\n\\begin{center}\nfoobar\n\nbuz\n\\end{center}\n), actual
686
+ expected = <<-EOS
687
+
688
+ \\begin{center}
689
+ foobar
690
+
691
+ buz
692
+ \\end{center}
693
+ EOS
694
+ assert_equal expected, actual
407
695
  end
408
696
 
409
697
  def test_blankline
410
698
  actual = compile_block("//blankline\nfoo\n")
411
- assert_equal %Q(\\vspace*{\\baselineskip}\n\nfoo\n), actual
699
+ expected = <<-EOS
700
+ \\vspace*{\\baselineskip}
701
+
702
+ foo
703
+ EOS
704
+ assert_equal expected, actual
412
705
  end
413
706
 
414
707
  def test_noindent
415
708
  actual = compile_block("//noindent\nfoo\nbar\n\nfoo2\nbar2\n")
416
- assert_equal %Q(\\noindent\nfoo\nbar\n\nfoo2\nbar2\n), actual
709
+ expected = <<-EOS
710
+ \\noindent
711
+ foo
712
+ bar
713
+
714
+ foo2
715
+ bar2
716
+ EOS
717
+ assert_equal expected, actual
417
718
  end
418
719
 
419
720
  def test_image
@@ -424,7 +725,14 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
424
725
  end
425
726
 
426
727
  actual = compile_block("//image[sampleimg][sample photo]{\n//}\n")
427
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}\n\\caption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
728
+ expected = <<-EOS
729
+ \\begin{reviewimage}%%sampleimg
730
+ \\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}
731
+ \\caption{sample photo}
732
+ \\label{image:chap1:sampleimg}
733
+ \\end{reviewimage}
734
+ EOS
735
+ assert_equal expected, actual
428
736
  end
429
737
 
430
738
  def test_image_with_metric
@@ -435,7 +743,14 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
435
743
  end
436
744
 
437
745
  actual = compile_block("//image[sampleimg][sample photo][scale=1.2]{\n//}\n")
438
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}\n\\caption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
746
+ expected = <<-EOS
747
+ \\begin{reviewimage}%%sampleimg
748
+ \\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}
749
+ \\caption{sample photo}
750
+ \\label{image:chap1:sampleimg}
751
+ \\end{reviewimage}
752
+ EOS
753
+ assert_equal expected, actual
439
754
  end
440
755
 
441
756
  def test_image_with_metric_width
@@ -447,7 +762,14 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
447
762
 
448
763
  @config['image_scale2width'] = true
449
764
  actual = compile_block("//image[sampleimg][sample photo][scale=1.2]{\n//}\n")
450
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=1.2\\maxwidth]{./images/chap1-sampleimg.png}\n\\caption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
765
+ expected = <<-EOS
766
+ \\begin{reviewimage}%%sampleimg
767
+ \\includegraphics[width=1.2\\maxwidth]{./images/chap1-sampleimg.png}
768
+ \\caption{sample photo}
769
+ \\label{image:chap1:sampleimg}
770
+ \\end{reviewimage}
771
+ EOS
772
+ assert_equal expected, actual
451
773
  end
452
774
 
453
775
  def test_image_with_metric2
@@ -458,7 +780,14 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
458
780
  end
459
781
 
460
782
  actual = compile_block("//image[sampleimg][sample photo][scale=1.2,html::class=sample,latex::ignore=params]{\n//}\n")
461
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2,ignore=params]{./images/chap1-sampleimg.png}\n\\caption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
783
+ expected = <<-EOS
784
+ \\begin{reviewimage}%%sampleimg
785
+ \\includegraphics[scale=1.2,ignore=params]{./images/chap1-sampleimg.png}
786
+ \\caption{sample photo}
787
+ \\label{image:chap1:sampleimg}
788
+ \\end{reviewimage}
789
+ EOS
790
+ assert_equal expected, actual
462
791
  end
463
792
 
464
793
  def test_image_with_metric2_width
@@ -470,7 +799,14 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
470
799
 
471
800
  @config['image_scale2width'] = true
472
801
  actual = compile_block("//image[sampleimg][sample photo][scale=1.2,html::class=sample,latex::ignore=params]{\n//}\n")
473
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=1.2\\maxwidth,ignore=params]{./images/chap1-sampleimg.png}\n\\caption{sample photo}\n\\label{image:chap1:sampleimg}\n\\end{reviewimage}\n), actual
802
+ expected = <<-EOS
803
+ \\begin{reviewimage}%%sampleimg
804
+ \\includegraphics[width=1.2\\maxwidth,ignore=params]{./images/chap1-sampleimg.png}
805
+ \\caption{sample photo}
806
+ \\label{image:chap1:sampleimg}
807
+ \\end{reviewimage}
808
+ EOS
809
+ assert_equal expected, actual
474
810
  end
475
811
 
476
812
  def test_indepimage
@@ -481,7 +817,13 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
481
817
  end
482
818
 
483
819
  actual = compile_block("//indepimage[sampleimg][sample photo]\n")
484
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}\n\\reviewindepimagecaption{図: sample photo}\n\\end{reviewimage}\n), actual
820
+ expected = <<-EOS
821
+ \\begin{reviewimage}%%sampleimg
822
+ \\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}
823
+ \\reviewindepimagecaption{図: sample photo}
824
+ \\end{reviewimage}
825
+ EOS
826
+ assert_equal expected, actual
485
827
  end
486
828
 
487
829
  def test_indepimage_without_caption
@@ -493,7 +835,12 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
493
835
 
494
836
  # FIXME: indepimage's caption should not be with a counter.
495
837
  actual = compile_block("//indepimage[sampleimg]\n")
496
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}\n\\end{reviewimage}\n), actual
838
+ expected = <<-EOS
839
+ \\begin{reviewimage}%%sampleimg
840
+ \\includegraphics[width=\\maxwidth]{./images/chap1-sampleimg.png}
841
+ \\end{reviewimage}
842
+ EOS
843
+ assert_equal expected, actual
497
844
  end
498
845
 
499
846
  def test_indepimage_with_metric
@@ -504,7 +851,13 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
504
851
  end
505
852
 
506
853
  actual = compile_block("//indepimage[sampleimg][sample photo][scale=1.2]\n")
507
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}\n\\reviewindepimagecaption{図: sample photo}\n\\end{reviewimage}\n), actual
854
+ expected = <<-EOS
855
+ \\begin{reviewimage}%%sampleimg
856
+ \\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}
857
+ \\reviewindepimagecaption{図: sample photo}
858
+ \\end{reviewimage}
859
+ EOS
860
+ assert_equal expected, actual
508
861
  end
509
862
 
510
863
  def test_indepimage_with_metric_width
@@ -516,7 +869,13 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
516
869
 
517
870
  @config['image_scale2width'] = true
518
871
  actual = compile_block("//indepimage[sampleimg][sample photo][scale=1.2]\n")
519
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[width=1.2\\maxwidth]{./images/chap1-sampleimg.png}\n\\reviewindepimagecaption{図: sample photo}\n\\end{reviewimage}\n), actual
872
+ expected = <<-EOS
873
+ \\begin{reviewimage}%%sampleimg
874
+ \\includegraphics[width=1.2\\maxwidth]{./images/chap1-sampleimg.png}
875
+ \\reviewindepimagecaption{図: sample photo}
876
+ \\end{reviewimage}
877
+ EOS
878
+ assert_equal expected, actual
520
879
  end
521
880
 
522
881
  def test_indepimage_with_metric2
@@ -527,7 +886,13 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
527
886
  end
528
887
 
529
888
  actual = compile_block(%Q(//indepimage[sampleimg][sample photo][scale=1.2, html::class="sample",latex::ignore=params]\n))
530
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2,ignore=params]{./images/chap1-sampleimg.png}\n\\reviewindepimagecaption{図: sample photo}\n\\end{reviewimage}\n), actual
889
+ expected = <<-EOS
890
+ \\begin{reviewimage}%%sampleimg
891
+ \\includegraphics[scale=1.2,ignore=params]{./images/chap1-sampleimg.png}
892
+ \\reviewindepimagecaption{図: sample photo}
893
+ \\end{reviewimage}
894
+ EOS
895
+ assert_equal expected, actual
531
896
  end
532
897
 
533
898
  def test_indepimage_without_caption_but_with_metric
@@ -539,36 +904,106 @@ class LATEXBuidlerV2Test < Test::Unit::TestCase
539
904
 
540
905
  # FIXME: indepimage's caption should not be with a counter.
541
906
  actual = compile_block("//indepimage[sampleimg][][scale=1.2]\n")
542
- assert_equal %Q(\\begin{reviewimage}%%sampleimg\n\\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}\n\\end{reviewimage}\n), actual
907
+ expected = <<-EOS
908
+ \\begin{reviewimage}%%sampleimg
909
+ \\includegraphics[scale=1.2]{./images/chap1-sampleimg.png}
910
+ \\end{reviewimage}
911
+ EOS
912
+ assert_equal expected, actual
543
913
  end
544
914
 
545
915
  def test_table
546
916
  actual = compile_block("//table{\naaa\tbbb\n------------\nccc\tddd<>&\n//}\n")
547
- assert_equal "\\begin{reviewtable}{|l|l|}\n\\hline\n\\reviewth{aaa} & \\reviewth{bbb} \\\\ \\hline\nccc & ddd\\textless{}\\textgreater{}\\& \\\\ \\hline\n\\end{reviewtable}\n",
548
- actual
917
+ expected = <<-EOS
918
+ \\begin{reviewtable}{|l|l|}
919
+ \\hline
920
+ \\reviewth{aaa} & \\reviewth{bbb} \\\\ \\hline
921
+ ccc & ddd\\textless{}\\textgreater{}\\& \\\\ \\hline
922
+ \\end{reviewtable}
923
+ EOS
924
+ assert_equal expected, actual
925
+
926
+ actual = compile_block("//table[foo][FOO]{\naaa\tbbb\n------------\nccc\tddd<>&\n//}\n")
927
+ expected = <<-EOS
928
+ \\begin{table}[h]%%foo
929
+ \\reviewtablecaption{FOO}
930
+ \\label{table:chap1:foo}
931
+ \\begin{reviewtable}{|l|l|}
932
+ \\hline
933
+ \\reviewth{aaa} & \\reviewth{bbb} \\\\ \\hline
934
+ ccc & ddd\\textless{}\\textgreater{}\\& \\\\ \\hline
935
+ \\end{reviewtable}
936
+ \\end{table}
937
+ EOS
938
+ assert_equal expected, actual
549
939
  end
550
940
 
551
941
  def test_customize_cellwidth
552
942
  actual = compile_block("//tsize[2,3,5]\n//table{\nA\tB\tC\n//}\n")
553
- assert_equal %Q(\\begin{reviewtable}{|p{2mm}|p{3mm}|p{5mm}|}\n\\hline\n\\reviewth{A} & B & C \\\\ \\hline\n\\end{reviewtable}\n), actual
943
+ expected = <<-EOS
944
+ \\begin{reviewtable}{|p{2mm}|p{3mm}|p{5mm}|}
945
+ \\hline
946
+ \\reviewth{A} & B & C \\\\ \\hline
947
+ \\end{reviewtable}
948
+ EOS
949
+ assert_equal expected, actual
554
950
 
555
951
  actual = compile_block("//tsize[|latex,html|2,3,5]\n//table{\nA\tB\tC\n//}\n")
556
- assert_equal %Q(\\begin{reviewtable}{|p{2mm}|p{3mm}|p{5mm}|}\n\\hline\n\\reviewth{A} & B & C \\\\ \\hline\n\\end{reviewtable}\n), actual
952
+ expected = <<-EOS
953
+ \\begin{reviewtable}{|p{2mm}|p{3mm}|p{5mm}|}
954
+ \\hline
955
+ \\reviewth{A} & B & C \\\\ \\hline
956
+ \\end{reviewtable}
957
+ EOS
958
+ assert_equal expected, actual
557
959
 
558
960
  actual = compile_block("//tsize[|html|2,3,5]\n//table{\nA\tB\tC\n//}\n")
559
- assert_equal %Q(\\begin{reviewtable}{|l|l|l|}\n\\hline\n\\reviewth{A} & B & C \\\\ \\hline\n\\end{reviewtable}\n), actual
961
+ expected = <<-EOS
962
+ \\begin{reviewtable}{|l|l|l|}
963
+ \\hline
964
+ \\reviewth{A} & B & C \\\\ \\hline
965
+ \\end{reviewtable}
966
+ EOS
967
+ assert_equal expected, actual
560
968
 
561
969
  actual = compile_block("//tsize[|latex|2,3,5]\n//table{\nA\tB\tC\n//}\n")
562
- assert_equal %Q(\\begin{reviewtable}{|p{2mm}|p{3mm}|p{5mm}|}\n\\hline\n\\reviewth{A} & B & C \\\\ \\hline\n\\end{reviewtable}\n), actual
970
+ expected = <<-EOS
971
+ \\begin{reviewtable}{|p{2mm}|p{3mm}|p{5mm}|}
972
+ \\hline
973
+ \\reviewth{A} & B & C \\\\ \\hline
974
+ \\end{reviewtable}
975
+ EOS
976
+ assert_equal expected, actual
563
977
 
564
978
  actual = compile_block("//tsize[|latex||p{5mm}|cr|]\n//table{\nA\tB\tC\n//}\n")
565
- assert_equal %Q(\\begin{reviewtable}{|p{5mm}|cr|}\n\\hline\n\\reviewth{A} & B & C \\\\ \\hline\n\\end{reviewtable}\n), actual
979
+ expected = <<-EOS
980
+ \\begin{reviewtable}{|p{5mm}|cr|}
981
+ \\hline
982
+ \\reviewth{A} & B & C \\\\ \\hline
983
+ \\end{reviewtable}
984
+ EOS
985
+ assert_equal expected, actual
566
986
  end
567
987
 
568
988
  def test_emtable
569
989
  actual = compile_block("//emtable[foo]{\naaa\tbbb\n------------\nccc\tddd<>&\n//}\n//emtable{\naaa\tbbb\n------------\nccc\tddd<>&\n//}\n")
570
- assert_equal "\\begin{table}[h]%%\n\\reviewtablecaption*{foo}\n\\begin{reviewtable}{|l|l|}\n\\hline\n\\reviewth{aaa} & \\reviewth{bbb} \\\\ \\hline\nccc & ddd\\textless{}\\textgreater{}\\& \\\\ \\hline\n\\end{reviewtable}\n\\end{table}\n\n\\begin{reviewtable}{|l|l|}\n\\hline\n\\reviewth{aaa} & \\reviewth{bbb} \\\\ \\hline\nccc & ddd\\textless{}\\textgreater{}\\& \\\\ \\hline\n\\end{reviewtable}\n",
571
- actual
990
+ expected = <<-EOS
991
+ \\begin{table}[h]%%
992
+ \\reviewtablecaption*{foo}
993
+ \\begin{reviewtable}{|l|l|}
994
+ \\hline
995
+ \\reviewth{aaa} & \\reviewth{bbb} \\\\ \\hline
996
+ ccc & ddd\\textless{}\\textgreater{}\\& \\\\ \\hline
997
+ \\end{reviewtable}
998
+ \\end{table}
999
+
1000
+ \\begin{reviewtable}{|l|l|}
1001
+ \\hline
1002
+ \\reviewth{aaa} & \\reviewth{bbb} \\\\ \\hline
1003
+ ccc & ddd\\textless{}\\textgreater{}\\& \\\\ \\hline
1004
+ \\end{reviewtable}
1005
+ EOS
1006
+ assert_equal expected, actual
572
1007
  end
573
1008
 
574
1009
  def test_imgtable
@@ -606,7 +1041,14 @@ EOS
606
1041
  end
607
1042
 
608
1043
  actual = compile_block("//bibpaper[samplebib][sample bib @<b>{bold}]{\na\nb\n//}\n")
609
- assert_equal %Q([1] sample bib \\textbf{bold}\n\\label{bib:samplebib}\n\nab\n\n), actual
1044
+ expected = <<-EOS
1045
+ [1] sample bib \\textbf{bold}
1046
+ \\label{bib:samplebib}
1047
+
1048
+ ab
1049
+
1050
+ EOS
1051
+ assert_equal expected, actual
610
1052
  end
611
1053
 
612
1054
  def test_bibpaper_without_body
@@ -615,7 +1057,12 @@ EOS
615
1057
  end
616
1058
 
617
1059
  actual = compile_block("//bibpaper[samplebib][sample bib]\n")
618
- assert_equal %Q([1] sample bib\n\\label{bib:samplebib}\n\n), actual
1060
+ expected = <<-EOS
1061
+ [1] sample bib
1062
+ \\label{bib:samplebib}
1063
+
1064
+ EOS
1065
+ assert_equal expected, actual
619
1066
  end
620
1067
 
621
1068
  def column_helper(review)
@@ -739,8 +1186,10 @@ EOS
739
1186
  expected = <<-EOS
740
1187
 
741
1188
  \\begin{itemize}
742
- \\item AAA{-}AA
743
- \\item BBB{-}BB
1189
+ \\item AAA
1190
+ {-}AA
1191
+ \\item BBB
1192
+ {-}BB
744
1193
  \\end{itemize}
745
1194
  EOS
746
1195
  actual = compile_block(src)
@@ -832,35 +1281,115 @@ EOS
832
1281
 
833
1282
  def test_major_blocks
834
1283
  actual = compile_block("//note{\nA\n\nB\n//}\n//note[caption]{\nA\n//}")
835
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1284
+ expected = <<-EOS
1285
+ \\begin{reviewminicolumn}
1286
+ A
1287
+
1288
+ B
1289
+ \\end{reviewminicolumn}
1290
+ \\begin{reviewminicolumn}
1291
+ \\reviewminicolumntitle{caption}
1292
+ A
1293
+ \\end{reviewminicolumn}
1294
+ EOS
836
1295
  assert_equal expected, actual
837
1296
 
838
1297
  actual = compile_block("//memo{\nA\n\nB\n//}\n//memo[caption]{\nA\n//}")
839
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1298
+ expected = <<-EOS
1299
+ \\begin{reviewminicolumn}
1300
+ A
1301
+
1302
+ B
1303
+ \\end{reviewminicolumn}
1304
+ \\begin{reviewminicolumn}
1305
+ \\reviewminicolumntitle{caption}
1306
+ A
1307
+ \\end{reviewminicolumn}
1308
+ EOS
840
1309
  assert_equal expected, actual
841
1310
 
842
1311
  actual = compile_block("//info{\nA\n\nB\n//}\n//info[caption]{\nA\n//}")
843
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1312
+ expected = <<-EOS
1313
+ \\begin{reviewminicolumn}
1314
+ A
1315
+
1316
+ B
1317
+ \\end{reviewminicolumn}
1318
+ \\begin{reviewminicolumn}
1319
+ \\reviewminicolumntitle{caption}
1320
+ A
1321
+ \\end{reviewminicolumn}
1322
+ EOS
844
1323
  assert_equal expected, actual
845
1324
 
846
1325
  actual = compile_block("//important{\nA\n\nB\n//}\n//important[caption]{\nA\n//}")
847
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1326
+ expected = <<-EOS
1327
+ \\begin{reviewminicolumn}
1328
+ A
1329
+
1330
+ B
1331
+ \\end{reviewminicolumn}
1332
+ \\begin{reviewminicolumn}
1333
+ \\reviewminicolumntitle{caption}
1334
+ A
1335
+ \\end{reviewminicolumn}
1336
+ EOS
848
1337
  assert_equal expected, actual
849
1338
 
850
1339
  actual = compile_block("//caution{\nA\n\nB\n//}\n//caution[caption]{\nA\n//}")
851
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1340
+ expected = <<-EOS
1341
+ \\begin{reviewminicolumn}
1342
+ A
1343
+
1344
+ B
1345
+ \\end{reviewminicolumn}
1346
+ \\begin{reviewminicolumn}
1347
+ \\reviewminicolumntitle{caption}
1348
+ A
1349
+ \\end{reviewminicolumn}
1350
+ EOS
852
1351
  assert_equal expected, actual
853
1352
 
854
1353
  actual = compile_block("//notice{\nA\n\nB\n//}\n//notice[caption]{\nA\n//}")
855
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1354
+ expected = <<-EOS
1355
+ \\begin{reviewminicolumn}
1356
+ A
1357
+
1358
+ B
1359
+ \\end{reviewminicolumn}
1360
+ \\begin{reviewminicolumn}
1361
+ \\reviewminicolumntitle{caption}
1362
+ A
1363
+ \\end{reviewminicolumn}
1364
+ EOS
856
1365
  assert_equal expected, actual
857
1366
 
858
1367
  actual = compile_block("//warning{\nA\n\nB\n//}\n//warning[caption]{\nA\n//}")
859
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1368
+ expected = <<-EOS
1369
+ \\begin{reviewminicolumn}
1370
+ A
1371
+
1372
+ B
1373
+ \\end{reviewminicolumn}
1374
+ \\begin{reviewminicolumn}
1375
+ \\reviewminicolumntitle{caption}
1376
+ A
1377
+ \\end{reviewminicolumn}
1378
+ EOS
860
1379
  assert_equal expected, actual
861
1380
 
862
1381
  actual = compile_block("//tip{\nA\n\nB\n//}\n//tip[caption]{\nA\n//}")
863
- expected = %Q(\\begin{reviewminicolumn}\nA\n\nB\n\\end{reviewminicolumn}\n\\begin{reviewminicolumn}\n\\reviewminicolumntitle{caption}\nA\n\\end{reviewminicolumn}\n)
1382
+ expected = <<-EOS
1383
+ \\begin{reviewminicolumn}
1384
+ A
1385
+
1386
+ B
1387
+ \\end{reviewminicolumn}
1388
+ \\begin{reviewminicolumn}
1389
+ \\reviewminicolumntitle{caption}
1390
+ A
1391
+ \\end{reviewminicolumn}
1392
+ EOS
864
1393
  assert_equal expected, actual
865
1394
  end
866
1395