Sha256: 1fca6432a908fca596fd42bc41b360c948abd795ebe49a20ec3e1fb00009f15c

Contents?: true

Size: 743 Bytes

Versions: 10

Compression:

Stored size: 743 Bytes

Contents

require 'spec_helper'

describe Paperclip::Processors::DeflaterBase do
  let(:attachment) { double }
  let(:no_deflate) { nil }
  let(:options) { {} }
  let(:file) { test_file }
  subject { Paperclip::Processors::DeflaterBase.new(file, options, attachment) }
  before do
    allow(attachment).to receive(:instance_read).with(:no_deflate).and_return(no_deflate)
  end
  describe "#make" do
    it "raises an exception" do
      expect{ subject.make }.to raise_error(NotImplementedError)
    end
  end
  describe "private methods" do
    describe "create_tempfile" do
      it "returns a tempfile" do
        f = subject.send(:create_tempfile)
        expect(f).to be_a Tempfile
        expect(f.binmode?).to be true
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
paperclip-deflater-0.1.6 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.1.5 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.1.4 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.1.3 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.1.2 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.1.1 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.1.0 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.0.7 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.0.6 spec/paperclip/processors/deflater_base_spec.rb
paperclip-deflater-0.0.4 spec/paperclip/processors/deflater_base_spec.rb