test/test_builder.rb in review-1.0.0 vs test/test_builder.rb in review-1.1.0

- old
+ new

@@ -96,11 +96,10 @@ [ :list_header, :list_body, :listnum_body, :source_header, :source_body, :image_image, :image_dummy, :table_header, :table_begin, :tr, :th, :table_end, - :nofunc_text, :compile_ruby, :compile_kw, :compile_href, :bibpaper_header, :bibpaper_bibpaper, :inline_hd_chap, ].each do |m| b = Builder.new @@ -111,21 +110,29 @@ def test_compile_inline text = "abc" assert_equal [:text, text], @b.compile_inline(text) end - def test_convert_outencoding_1arg - ReVIEW.book.param = {'outencoding' => "UTF-8"} - b = Builder.new - ret = b.convert_outencoding("a") - assert_equal "a", ret + def test_inline_ruby + def @b.compile_ruby(base,ruby) + [base,ruby] + end + str = @b.inline_ruby("foo,bar") + assert_equal str, ["foo","bar"] + str = @b.inline_ruby("foo\\,\\,,\\,bar,buz") + assert_equal str, ["foo,,",",bar,buz"] end - def test_convert_outencoding_2arg - ReVIEW.book.param = {'outencoding' => "UTF-8"} + def test_compile_inline_backslash + text = "abc\\d\\#a" + assert_equal [:text, text], @b.compile_inline(text) + end + + def test_convert_outencoding + ReVIEW.book.param = {'outencoding' => "EUC"} b = Builder.new - ret = b.convert_outencoding("a","b") - assert_equal(["a","b"], ret) + ret = b.convert_outencoding("a", ReVIEW.book.param["outencoding"]) + assert_equal "a", ret end class XBuilder < Builder def list_header(id, caption) end