test/test_index.rb in review-2.3.0 vs test/test_index.rb in review-2.4.0

- old
+ new

@@ -1,7 +1,5 @@ -# encoding: utf-8 - require 'test_helper' require 'review/book' require 'review/book/index' class IndexTest < Test::Unit::TestCase @@ -38,11 +36,11 @@ # rubocop:disable Style/PreferredHashMethods assert_equal true, fn.has_key?('foo') # rubocop:enable Style/PreferredHashMethods end - def test_HeadelineIndex + def test_headeline_index src = <<-EOB = chap1 == sec1-1 == sec1-2 === sec1-2-1 @@ -55,15 +53,15 @@ ==== sec1-3-0-1 EOB book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) # dummy index = Book::HeadlineIndex.parse(src, chap) - assert_equal [2,2], index['sec1-2|sec1-2-2'].number - assert_equal "1.2.2", index.number('sec1-2|sec1-2-2') + assert_equal [2, 2], index['sec1-2|sec1-2-2'].number + assert_equal '1.2.2', index.number('sec1-2|sec1-2-2') end - def test_HeadelineIndex2 + def test_headeline_index2 src = <<-EOB = chap1 == sec1-1 == sec1-2 === sec1-2-1 @@ -72,15 +70,15 @@ === sec1-3-1 EOB book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) # dummy index = Book::HeadlineIndex.parse(src, chap) - assert_equal [3,1], index['sec1-3|sec1-3-1'].number - assert_equal "1.3.1", index.number('sec1-3|sec1-3-1') + assert_equal [3, 1], index['sec1-3|sec1-3-1'].number + assert_equal '1.3.1', index.number('sec1-3|sec1-3-1') end - def test_HeadelineIndex3 + def test_headeline_index3 src = <<-EOB = chap1 == sec1-1 == sec1-2 === sec1-2-1 @@ -90,18 +88,18 @@ === sec1-3-1 EOB book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) # dummy index = Book::HeadlineIndex.parse(src, chap) - assert_equal [2,2], index['sec1-2|sec1-2-2'].number - assert_equal "1.2.2", index.number('sec1-2|sec1-2-2') + assert_equal [2, 2], index['sec1-2|sec1-2-2'].number + assert_equal '1.2.2', index.number('sec1-2|sec1-2-2') - assert_equal [3,1], index['sec1-3|sec1-3-1'].number - assert_equal "1.3.1", index.number('sec1-3|sec1-3-1') + assert_equal [3, 1], index['sec1-3|sec1-3-1'].number + assert_equal '1.3.1', index.number('sec1-3|sec1-3-1') end - def test_HeadelineIndex4 + def test_headeline_index4 src = <<-EOB = chap1 ====[column] c1 == sec1-1 == sec1-2 @@ -109,15 +107,15 @@ === sec1-2-2 EOB book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) # dummy index = Book::HeadlineIndex.parse(src, chap) - assert_equal [2,2], index['sec1-2|sec1-2-2'].number - assert_equal "1.2.2", index.number('sec1-2|sec1-2-2') + assert_equal [2, 2], index['sec1-2|sec1-2-2'].number + assert_equal '1.2.2', index.number('sec1-2|sec1-2-2') end - def test_HeadelineIndex5 + def test_headeline_index5 src = <<-EOB = chap1 ====[column] c1 == sec1-1 == sec1-2 @@ -125,30 +123,30 @@ === sec1-2-2 EOB book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) # dummy index = Book::HeadlineIndex.parse(src, chap) - assert_equal [2,2], index['sec1-2-2'].number - assert_equal "1.2.2", index.number('sec1-2-2') + assert_equal [2, 2], index['sec1-2-2'].number + assert_equal '1.2.2', index.number('sec1-2-2') end - def test_HeadelineIndex6 + def test_headeline_index6 src = <<-EOB = chap1 == sec1 === target == sec2 EOB book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) # dummy index = Book::HeadlineIndex.parse(src, chap) - assert_equal [1,1], index['target'].number - assert_equal "1.1.1", index.number('target') + assert_equal [1, 1], index['target'].number + assert_equal '1.1.1', index.number('target') end - def test_HeadelineIndex7 + def test_headeline_index7 src = <<-EOB = chap1 == sec1 === target ^-- dummy target @@ -160,26 +158,23 @@ book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) # dummy index = Book::HeadlineIndex.parse(src, chap) assert_raise ReVIEW::KeyError do - assert_equal [1,1], index['target'].number + assert_equal [1, 1], index['target'].number end end - def test_HeadelineIndex8 + def test_headeline_index8 src = <<-EOB = chap1 == sec1 === sec1-1 ==== sec1-1-1 EOB book = Book::Base.load chap = Book::Chapter.new(book, 1, '-', nil) index = Book::HeadlineIndex.parse(src, chap) - assert_equal "1.1.1", index.number('sec1-1') + assert_equal '1.1.1', index.number('sec1-1') end - - end -