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

- old
+ new

@@ -10,10 +10,21 @@ subject.wkhtmltopdf end end end + describe "#executable" do + it "returns wkhtmltopdf by default" do + expect(subject.executable).to eql subject.wkhtmltopdf + end + + it "uses xvfb-run wrapper when option of using xvfb is configured" do + expect(subject).to receive(:using_xvfb?).and_return(true) + expect(subject.executable).to include 'xvfb-run' + end + end + describe "#default_options" do it "sets defaults for the command options" do expect(subject.default_options[:disable_smart_shrinking]).to eql false expect(subject.default_options[:quiet]).to eql true expect(subject.default_options[:page_size]).to eql 'Letter' @@ -48,9 +59,25 @@ end it "is configurable" do subject.meta_tag_prefix = 'aDifferentPrefix-' expect(subject.meta_tag_prefix).to eql 'aDifferentPrefix-' + end + end + + describe "#using_xvfb?" do + it "can be configured to true" do + subject.use_xvfb = true + expect(subject.using_xvfb?).to eql true + end + + it "defaults to false" do + expect(subject.using_xvfb?).to eql false + end + + it "can be configured to false" do + subject.use_xvfb = false + expect(subject.using_xvfb?).to eql false end end describe "#verbose?" do it "can be configured to true" do