Sha256: da895cecc92af2139cec684ef46d443fbc2ecdde79b68b282d854f278dc028b9

Contents?: true

Size: 629 Bytes

Versions: 1

Compression:

Stored size: 629 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Paperclip::Processors::Deflater do
  let(:attachment) { double }
  let(:should_deflate) { true }
  let(:options) { {} }
  let(:file) { test_file }
  subject { Paperclip::Processors::Deflater.new(file, options, attachment) }
  before do
    allow(attachment).to receive(:instance_read).with(:deflate).and_return(should_deflate)
  end
  describe "private methods" do
    describe "#make_impl" do
      it "deflates the file" do
        dst = subject.make
        data = dst.read
        expect(data.unpack('H*').first).to eq("x\x9C".unpack('H*').first)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
paperclip-deflater-0.0.2 spec/paperclip/processors/deflater_spec.rb