Skip to content

Commit

Permalink
Fix spec tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dtaniwaki committed Jun 29, 2015
1 parent 09538eb commit d443bb8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions spec/paperclip/processors/gzip_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,14 @@
it "deflates the file" do
dst = subject.make
data = dst.read
expect(data[0..3]).to eq(result1)
# data[4..7] is modified time and it changes
expect(data[8..-1]).to eq(result2)
expect(data.bytes).to match(result)
end
end
let(:result1) { "\u001F\x8B\b\u0000" }
let(:result2) { "\u0000\u0003+I-.\xE1\u0002\u0000\xC65\xB9;\u0005\u0000\u0000\u0000" }
let(:result) { [31, 139, 8, 0, anything, anything, anything, anything, 0, 3, 43, 73, 45, 46, 225, 2, 0, 198, 53, 185, 59, 5, 0, 0, 0] }
include_examples "deflate"
context "level gzip_options" do
let(:result2) { "\u0002\u0003+I-.\xE1\u0002\u0000\xC65\xB9;\u0005\u0000\u0000\u0000" }
let(:result) { [31, 139, 8, 0, anything, anything, anything, anything, 2, 3, 43, 73, 45, 46, 225, 2, 0, 198, 53, 185, 59, 5, 0, 0, 0] }
let(:options) { {gzip_options: {level: Zlib::BEST_COMPRESSION}} }
include_examples "deflate"
end
Expand Down

0 comments on commit d443bb8

Please sign in to comment.