test/test_pandoc-ruby.rb in pandoc-ruby-0.7.1 vs test/test_pandoc-ruby.rb in pandoc-ruby-0.7.2

- old
+ new

@@ -41,41 +41,41 @@ assert @converter.convert end should "accept long options" do converter = PandocRuby.new(@file, :to => :rst) - converter.expects(:execute).with('pandoc --to=rst').returns(true) + converter.expects(:execute).with('pandoc --to rst').returns(true) assert converter.convert end should "accept a variety of options in initializer" do converter = PandocRuby.new(@file, :s, { :f => :markdown, :to => :rst }, 'no-wrap') converter \ .expects(:execute) \ - .with('pandoc -s -f markdown --to=rst --no-wrap') \ + .with('pandoc -s -f markdown --to rst --no-wrap') \ .returns(true) assert converter.convert end should "accept a variety of options in convert" do converter = PandocRuby.new(@file) converter \ .expects(:execute) \ - .with('pandoc -s -f markdown --to=rst --no-wrap') \ + .with('pandoc -s -f markdown --to rst --no-wrap') \ .returns(true) assert converter.convert(:s, {:f => :markdown, :to => :rst}, 'no-wrap') end should "convert underscore symbol ares to hyphenated long options" do converter = PandocRuby.new(@file, { :email_obfuscation => :javascript }, :table_of_contents) converter \ .expects(:execute) \ - .with('pandoc --email-obfuscation=javascript --table-of-contents') \ + .with('pandoc --email-obfuscation javascript --table-of-contents') \ .returns(true) assert converter.convert end should "accept optional executable" do @@ -91,32 +91,32 @@ end PandocRuby::READERS.each_key do |r| should "convert from #{r} with PandocRuby.#{r}" do converter = PandocRuby.send(r, @file) - converter.expects(:execute).with("pandoc --from=#{r}").returns(true) + converter.expects(:execute).with("pandoc --from #{r}").returns(true) assert converter.convert end end - PandocRuby::WRITERS.each_key do |w| + PandocRuby::STRING_WRITERS.each_key do |w| should "convert to #{w} with to_#{w}" do converter = PandocRuby.new(@file) converter \ .expects(:execute) \ - .with("pandoc --no-wrap --to=#{w}") \ + .with("pandoc --no-wrap --to #{w}") \ .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=/)) \ + .with(regexp_matches(/^pandoc --no-wrap --to #{w} --output /)) \ .returns(true) assert converter.send("to_#{w}", :no_wrap) end end @@ -153,11 +153,11 @@ "markdown" => "markdown", "json" => "pandoc JSON", "rst" => "reStructuredText" } - assert_equal PandocRuby::WRITERS, { + assert_equal PandocRuby::STRING_WRITERS, { "mediawiki" => "MediaWiki markup", "html" => "HTML", "plain" => "plain", "latex" => "LaTeX", "s5" => "S5 HTML slideshow", @@ -185,7 +185,10 @@ "docx" => "Word docx", "epub" => "EPUB V2", "epub3" => "EPUB V3" } + assert_equal PandocRuby::WRITERS, ( + PandocRuby::STRING_WRITERS.merge(PandocRuby::BINARY_WRITERS) + ) end end