spec/PDFKit_spec.rb in pdfkit-0.3.2 vs spec/PDFKit_spec.rb in pdfkit-0.3.3

- old
+ new

@@ -40,12 +40,25 @@ end end context "command" do it "should contstruct the correct command" do - pdfkit = PDFKit.new('html', :page_size => 'Letter') + pdfkit = PDFKit.new('html', :page_size => 'Letter', :toc_l1_font_size => 12) pdfkit.command.should include('wkhtmltopdf') pdfkit.command.should include('--page-size Letter') + pdfkit.command.should include('--toc-l1-font-size 12') + end + + it "will not include default options it is told to omit" do + pdfkit = PDFKit.new('html') + pdfkit.command.should include('--disable-smart-shrinking') + pdfkit = PDFKit.new('html', :disable_smart_shrinking => false) + pdfkit.command.should_not include('--disable-smart-shrinking') + end + + it "should encapsulate string arguments in quotes" do + pdfkit = PDFKit.new('html', :header_center => "foo [page]") + pdfkit.command.should include('--header-center "foo [page]"') end it "read the source from stdin if it is html" do pdfkit = PDFKit.new('html') pdfkit.command.should match(/ - -$/)