spec/PDFKit_spec.rb in pdfkit-0.3.1 vs spec/PDFKit_spec.rb in pdfkit-0.3.2
- old
+ new
@@ -1,6 +1,6 @@
-require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+require 'spec_helper'
describe PDFKit do
context "initialization" do
it "should accept HTML as the source" do
@@ -66,10 +66,10 @@
context "#to_pdf" do
it "should generate a PDF of the HTML" do
pdfkit = PDFKit.new('html', :page_size => 'Letter')
pdf = pdfkit.to_pdf
- pdf.should match(/^%PDF/) # PDF Signature at beginning of file
+ pdf[0...4].should == "%PDF" # PDF Signature at beginning of file
end
it "should have the stylesheet added to the head if it has one" do
pdfkit = PDFKit.new("<html><head></head><body>Hai!</body></html>")
css = File.join(SPEC_ROOT,'fixtures','example.css')