test/test_rstbuilder.rb in review-3.2.0 vs test/test_rstbuilder.rb in review-4.0.0

- old
+ new

@@ -205,15 +205,23 @@ end def test_paragraph actual = compile_block("foo\nbar\n") assert_equal %Q(foobar\n\n), actual + + @book.config['join_lines_by_lang'] = true + actual = compile_block("foo\nbar\n") + assert_equal %Q(foo bar\n\n), actual end def test_tabbed_paragraph actual = compile_block("\tfoo\nbar\n") assert_equal %Q(\tfoobar\n\n), actual + + @book.config['join_lines_by_lang'] = true + actual = compile_block("\tfoo\nbar\n") + assert_equal %Q(\tfoo bar\n\n), actual end def test_flushright actual = compile_block("//flushright{\nfoo\nbar\n\nbuz\n//}\n") expected = <<-EOS @@ -222,10 +230,21 @@ foobar buz EOS assert_equal expected, actual + + @book.config['join_lines_by_lang'] = true + actual = compile_block("//flushright{\nfoo\nbar\n\nbuz\n//}\n") + expected = <<-EOS +.. flushright:: + + foo bar +buz + +EOS + assert_equal expected, actual end def test_noindent actual = compile_block("//noindent\nfoo\nbar\n\nfoo2\nbar2\n") expected = <<-EOS @@ -233,10 +252,20 @@ foo2bar2 EOS assert_equal expected, actual + + @book.config['join_lines_by_lang'] = true + actual = compile_block("//noindent\nfoo\nbar\n\nfoo2\nbar2\n") + expected = <<-EOS +foo bar + +foo2 bar2 + +EOS + assert_equal expected, actual end def test_comment actual = compile_block('//comment[コメント]') assert_equal "\n", actual @@ -248,11 +277,11 @@ assert_equal "\n", actual end def test_list def @chapter.list(_id) - Book::ListIndex::Item.new('test', 1) + Book::Index::Item.new('test', 1) end actual = compile_block("//list[samplelist][this is @<b>{test}<&>_]{\nfoo\nbar\n//}\n") expected = <<-EOS .. _samplelist: @@ -262,11 +291,11 @@ assert_equal expected, actual end def test_listnum def @chapter.list(_id) - Book::ListIndex::Item.new('test', 1) + Book::Index::Item.new('test', 1) end actual = compile_block("//listnum[test][this is @<b>{test}<&>_]{\nfoo\nbar\n//}\n") expected = <<-EOS .. _test: @@ -414,11 +443,11 @@ assert_equal expected, actual end def test_image def @chapter.image(_id) - item = Book::ImageIndex::Item.new('sampleimg', 1) + item = Book::Index::Item.new('sampleimg', 1) item.instance_eval { @path = './images/chap1-sampleimg.png' } item end actual = compile_block("//image[sampleimg][sample photo]{\nfoo\n//}\n") @@ -433,10 +462,10 @@ assert_equal expected, actual end def test_image_with_metric def @chapter.image(_id) - item = Book::ImageIndex::Item.new('sampleimg', 1) + item = Book::Index::Item.new('sampleimg', 1) item.instance_eval { @path = './images/chap1-sampleimg.png' } item end actual = compile_block("//image[sampleimg][sample photo][scale=1.2]{\nfoo\n//}\n")