Permalink
Browse files

spec for the last merged issue of files getting data truncated in 1.8.6

  • Loading branch information...
1 parent 41e4df7 commit 7a9fe332f8d6264aea5ab554ec63fd85373973ed @mdeering mdeering committed Jun 17, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 spec/pdfkit_spec.rb
View
@@ -196,6 +196,15 @@
file.should be_instance_of(File)
File.read(file.path)[0...4].should == "%PDF" # PDF Signature at beginning of file
end
+
+ it "should not truncate data (in Ruby 1.8.6)" do
+ file_path = File.join(SPEC_ROOT,'fixtures','example.html')
+ pdfkit = PDFKit.new(File.new(file_path))
+ pdf_data = pdfkit.to_pdf
+ file = pdfkit.to_file(@file_path)
+ file_data = open(@file_path, 'rb') {|io| io.read }
+ pdf_data.size.should == file_data.size
+ end
end
context "security" do

0 comments on commit 7a9fe33

Please sign in to comment.