test/test_webtocprinter.rb in review-4.2.0 vs test/test_webtocprinter.rb in review-5.0.0
- old
+ new
@@ -9,11 +9,11 @@
def setup
I18n.setup
end
def test_webtocprinter_null
- dummy_book = ReVIEW::Book::Base.load
+ dummy_book = ReVIEW::Book::Base.new
# chap = ReVIEW::Book::Chapter.new(dummy_book, 1, '-', nil, StringIO.new)
str = WEBTOCPrinter.book_to_string(dummy_book)
expect = <<-EOB
<ul class="book-toc">
<li><a href="index.html">TOP</a></li>
@@ -26,13 +26,13 @@
catalog_yml = <<-EOB
CHAPS:
- ch1.re
- ch2.re
EOB
- mktmpbookdir 'catalog.yml' => catalog_yml,
+ mktmpbookdir('catalog.yml' => catalog_yml,
'ch1.re' => "= ch. 1\n\n111\n",
- 'ch2.re' => "= ch. 2\n\n222\n" do |_dir, book, _files|
+ 'ch2.re' => "= ch. 2\n\n222\n") do |_dir, book, _files|
str = WEBTOCPrinter.book_to_string(book)
expect = <<-EOB
<ul class="book-toc">
<li><a href="index.html">TOP</a></li>
<li><a href="ch1.html">第1章 ch. 1</a></li>
@@ -49,13 +49,13 @@
- part1:
- ch1.re
- part2:
- ch2.re
EOB
- mktmpbookdir 'catalog.yml' => catalog_yml,
+ mktmpbookdir('catalog.yml' => catalog_yml,
'ch1.re' => "= ch. 1\n\n111\n",
- 'ch2.re' => "= ch. 2\n\n222\n" do |_dir, book, _files|
+ 'ch2.re' => "= ch. 2\n\n222\n") do |_dir, book, _files|
str = WEBTOCPrinter.book_to_string(book)
expect = <<-EOB
<ul class="book-toc">
<li><a href="index.html">TOP</a></li>
<li>第I部 part1
@@ -76,15 +76,15 @@
- p1.re:
- ch1.re
- p2.re:
- ch2.re
EOB
- mktmpbookdir 'catalog.yml' => catalog_yml,
+ mktmpbookdir('catalog.yml' => catalog_yml,
'p1.re' => "= This is PART1\n\np111\n",
'p2.re' => "= This is PART2\n\np111\n",
'ch1.re' => "= ch. 1\n\n111\n",
- 'ch2.re' => "= ch. 2\n\n222\n" do |_dir, book, _files|
+ 'ch2.re' => "= ch. 2\n\n222\n") do |_dir, book, _files|
str = WEBTOCPrinter.book_to_string(book)
expect = <<-EOB
<ul class="book-toc">
<li><a href="index.html">TOP</a></li>
<li><a href="p1.html">第I部 This is PART1</a>
@@ -114,21 +114,21 @@
- app2.re
POSTDEF:
- post1.re
- post2.re
EOB
- mktmpbookdir 'catalog.yml' => catalog_yml,
+ mktmpbookdir('catalog.yml' => catalog_yml,
'pre1.re' => "= PRE1\n\npre111\n",
'pre2.re' => "= PRE2\n\npre222\n",
'app1.re' => "= APP1\n\napp111\n",
'app2.re' => "= APP2\n\napp222\n",
'part1.re' => "= PART1\n\np111\n",
'part2.re' => "= PART2\n\np111\n",
'post1.re' => "= POST1\n\npo111\n",
'post2.re' => "= POST2\n\npo222\n",
'ch1.re' => "= ch. 1\n\n111\n",
- 'ch2.re' => "= ch. 2\n\n222\n" do |_dir, book, _files|
+ 'ch2.re' => "= ch. 2\n\n222\n") do |_dir, book, _files|
str = WEBTOCPrinter.book_to_string(book)
expect = <<-EOB
<ul class="book-toc">
<li><a href="index.html">TOP</a></li>
<li><a href="pre1.html">PRE1</a></li>
@@ -151,11 +151,11 @@
def test_webtocprinter_nochapter
catalog_yml = <<-EOB
CHAPS:
EOB
- mktmpbookdir 'catalog.yml' => catalog_yml do |_dir, book, _files|
+ mktmpbookdir('catalog.yml' => catalog_yml) do |_dir, book, _files|
str = WEBTOCPrinter.book_to_string(book)
expect = <<-EOB
<ul class="book-toc">
<li><a href="index.html">TOP</a></li>
</ul>
@@ -170,14 +170,14 @@
- ch1.re
- ch2.re
- ch3.re
- ch4.re
EOB
- mktmpbookdir 'catalog.yml' => catalog_yml,
+ mktmpbookdir('catalog.yml' => catalog_yml,
'ch1.re' => "A\n",
'ch2.re' => "B\n\n= C\n== D\n",
'ch3.re' => "//emlist{\nLIST\n//}\n",
- 'ch4.re' => "==[column] E\n\n= F" do |_dir, book, _files|
+ 'ch4.re' => "==[column] E\n\n= F") do |_dir, book, _files|
str = WEBTOCPrinter.book_to_string(book)
expect = <<-EOB
<ul class="book-toc">
<li><a href="index.html">TOP</a></li>
<li><a href="ch1.html">-</a></li>