test/test_markdownbuilder.rb in review-2.0.0.beta1 vs test/test_markdownbuilder.rb in review-2.0.0
- old
+ new
@@ -10,16 +10,14 @@
include ReVIEW
def setup
@builder = MARKDOWNBuilder.new()
@config = {
- "secnolevel" => 2, # for IDGXMLBuilder, HTMLBuilder
- "inencoding" => "UTF-8",
- "outencoding" => "UTF-8",
- "stylesheet" => nil, # for HTMLBuilder
+ "secnolevel" => 2, # for IDGXMLBuilder, HTMLBuilder
+ "stylesheet" => nil, # for HTMLBuilder
}
- @book = Book::Base.new(nil)
+ @book = Book::Base.new(".")
@book.config = @config
@compiler = ReVIEW::Compiler.new(@builder)
@chapter = Book::Chapter.new(@book, 1, '-', nil, StringIO.new)
location = Location.new(nil, nil)
@builder.bind(@compiler, @chapter, location)
@@ -62,20 +60,38 @@
def test_cmd
actual = compile_block("//cmd{\nlineA\nlineB\n//}\n")
assert_equal "```shell-session\nlineA\nlineB\n```\n", actual
end
+
+ def test_dlist
+ actual = compile_block(": foo\n foo.\n bar.\n")
+ assert_equal %Q|<dl>\n<dt>foo</dt>\n<dd>foo.bar.</dd>\n</dl>\n|, actual
+ end
+
+ def test_dlist_with_bracket
+ actual = compile_block(": foo[bar]\n foo.\n bar.\n")
+ assert_equal %Q|<dl>\n<dt>foo[bar]</dt>\n<dd>foo.bar.</dd>\n</dl>\n|, actual
+ end
+
+ def test_dlist_with_comment
+ source = ": title\n body\n\#@ comment\n\#@ comment\n: title2\n body2\n"
+ actual = compile_block(source)
+ assert_equal %Q|<dl>\n<dt>title</dt>\n<dd>body</dd>\n<dt>title2</dt>\n<dd>body2</dd>\n</dl>\n|, actual
+ end
+
def test_list
actual = compile_block(<<-EOS)
//list[name][caption]{
AAA
BBB
//}
EOS
assert_equal <<-EOS, actual
リスト1.1 caption
+
```
AAA
BBB
```
EOS
@@ -89,10 +105,11 @@
//}
EOS
assert_equal <<-EOS, actual
リスト1.1 caption
+
```ruby
AAA
BBB
```
EOS
@@ -107,9 +124,10 @@
EOS
assert_equal <<-EOS, actual
caption
+
```ruby
AAA
BBB
```