test/test_pandoc-ruby.rb in pandoc-ruby-0.6.1 vs test/test_pandoc-ruby.rb in pandoc-ruby-0.7.0

- old
+ new

@@ -107,10 +107,21 @@ .returns(true) assert converter.send("to_#{w}", :no_wrap) end end + PandocRuby::BINARY_WRITERS.each_key do |w| + should "convert to #{w} with to_#{w}" do + converter = PandocRuby.new(@file) + converter \ + .expects(:execute) \ + .with(regexp_matches(/^pandoc --no-wrap --to=#{w} --output=/)) \ + .returns(true) + assert converter.send("to_#{w}", :no_wrap) + end + end + should "work with strings" do converter = PandocRuby.new('## this is a title') assert_match %r(h2), converter.convert end @@ -146,19 +157,17 @@ assert_equal PandocRuby::WRITERS, { "mediawiki" => "MediaWiki markup", "html" => "HTML", "plain" => "plain", - "docx" => "docx", "latex" => "LaTeX", "s5" => "S5 HTML slideshow", "textile" => "textile", "texinfo" => "GNU Texinfo", "docbook" => "DocBook XML", "html5" => "HTML5", "native" => "pandoc native", - "epub" => "epub", "org" => "emacs org mode", "rtf" => "rich text format", "markdown" => "markdown", "man" => "groff man", "dzslides" => "Dzslides HTML slideshow", @@ -166,11 +175,17 @@ "json" => "pandoc JSON", "opendocument" => "OpenDocument XML", "slidy" => "Slidy HTML slideshow", "rst" => "reStructuredText", "context" => "ConTeXt", - "odt" => "odt", "asciidoc" => "asciidoc" + } + + assert_equal PandocRuby::BINARY_WRITERS, { + "odt" => "OpenDocument", + "docx" => "Word docx", + "epub" => "EPUB V2", + "epub3" => "EPUB V3" } end end