diff --git a/test/test_htmlbuilder.rb b/test/test_htmlbuilder.rb index d99ad383a..f9b30a25d 100644 --- a/test/test_htmlbuilder.rb +++ b/test/test_htmlbuilder.rb @@ -365,6 +365,65 @@ def @chapter.image(id) assert_equal expected, actual end + def test_inline_imgref3 + Dir.mktmpdir do |dir| + Dir.chdir(dir) do + file1 = File.join(dir, "images", "img1.png") + filet1 = File.join(dir, "images", "tbl1.png") + file2 = File.join(dir, "images", "img2.png") + re1 = File.join(dir, "sample1.re") + cat = File.join(dir, "catalog.yml") + FileUtils.mkdir_p(File.join(dir,"images")) + File.open(file1, "w"){|f| f.write("")} + File.open(filet1, "w"){|f| f.write("")} + File.open(file2, "w"){|f| f.write("")} + File.open(cat, "w"){|f| f.write("CHAPS:\n - sample1.re\n")} + File.open(re1,"w"){|f| f.write(<{tbl1}. + +img2 is @{img2}. + +//image[img1][image 1]{ +//} + +//imgtable[tbl1][table 1]{ +//} + +//image[img2][image 2]{ +//} +EOF + content = File.read(re1) + actual = compile_block(content) + + expected =<<-EOS +

第1章 test

+

tbl1 is 表1.1.

+

img2 is 図1.2.

+
+image 1 +

+図1.1: image 1 +

+
+
+

表1.1: table 1

+table 1 +
+
+image 2 +

+図1.2: image 2 +

+
+EOS + + assert_equal expected, actual + end + end + end + def test_quote actual = compile_block("//quote{\nfoo\nbar\n\nbuz\n//}\n") assert_equal %Q|

foobar

\n

buz

\n|, actual