test/test_topbuilder.rb in review-2.1.0 vs test/test_topbuilder.rb in review-2.2.0

- old
+ new

@@ -11,13 +11,13 @@ def setup @builder = TOPBuilder.new() @config = ReVIEW::Configure.values @config.merge!({ - "secnolevel" => 2, - "language" => "ja", - }) + "secnolevel" => 2, + "language" => "ja", + }) @book = Book::Base.new(nil) @book.config = @config @compiler = ReVIEW::Compiler.new(@builder) @chapter = Book::Chapter.new(@book, 1, '-', nil, StringIO.new) location = Location.new(nil, nil) @@ -140,11 +140,11 @@ end def test_inline_comment_for_draft @config["draft"] = true actual = compile_inline("test @<comment>{コメント} test2") - assert_equal %Q|test ◆→DTP連絡:コメント←◆ test2|, actual + assert_equal %Q|test ◆→コメント←◆ test2|, actual end def test_inline_in_table actual = compile_block("//table{\n★1☆\t▲2☆\n------------\n★3☆\t▲4☆<>&\n//}\n") assert_equal %Q|★★1☆☆\t★▲2☆☆\n★3☆\t▲4☆<>&\n◆→終了:表←◆\n\n|, actual @@ -168,10 +168,21 @@ def test_noindent actual = compile_block("//noindent\nfoo\nbar\n\nfoo2\nbar2\n") assert_equal %Q|◆→DTP連絡:次の1行インデントなし←◆\nfoobar\nfoo2bar2\n|, actual end + def test_comment + actual = compile_block("//comment[コメント]") + assert_equal %Q||, actual + end + + def test_comment_for_draft + @config["draft"] = true + actual = compile_block("//comment[コメント]") + assert_equal %Q|◆→コメント←◆\n|, actual + end + def test_list def @chapter.list(id) Book::ListIndex::Item.new("test",1) end actual = compile_block("//list[samplelist][this is @<b>{test}<&>_]{\nfoo\nbar\n//}\n") @@ -187,9 +198,17 @@ end def test_emlistnum actual = compile_block("//emlistnum[this is @<b>{test}<&>_]{\nfoo\nbar\n//}\n") assert_equal %Q|◆→開始:インラインリスト←◆\n■this is ★test☆<&>_\n 1: foo\n 2: bar\n◆→終了:インラインリスト←◆\n\n|, actual + end + + def test_bib + def @chapter.bibpaper(id) + Book::BibpaperIndex::Item.new("samplebib",1,"sample bib") + end + + assert_equal %Q|[1]|, compile_inline("@<bib>{samplebib}") end def test_major_blocks actual = compile_block("//note{\nA\n\nB\n//}\n//note[caption]{\nA\n//}") expected = %Q(◆→開始:ノート←◆\nA\nB\n◆→終了:ノート←◆\n\n◆→開始:ノート←◆\n■caption\nA\n◆→終了:ノート←◆\n\n)