spec/pdfkit_spec.rb in pdfkit-0.8.3 vs spec/pdfkit_spec.rb in pdfkit-0.8.4

- old
+ new

@@ -382,9 +382,27 @@ PDFKit.configure do |config| config.verbose = false end end + it "does not use xvfb-run wrapper by default" do + pdfkit = PDFKit.new('html') + expect(pdfkit.command).not_to include 'xvfb-run' + end + + it "uses xvfb-run wrapper when option of using xvfb is configured" do + PDFKit.configure do |config| + config.use_xvfb = true + end + + pdfkit = PDFKit.new('html') + expect(pdfkit.command).to include 'xvfb-run' + + PDFKit.configure do |config| + config.use_xvfb = false + end + end + context "on windows" do before do allow(PDFKit::OS).to receive(:host_is_windows?).and_return(true) end