Sha256: 70970b95cf8b8a07443924d793ab830154ec42454ab54e2ede29d3dbd821c96d

Contents?: true

Size: 690 Bytes

Versions: 66

Compression:

Stored size: 690 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::PersistDerivatives do
  before do
    allow(CurationConcerns.config).to receive(:derivatives_path).and_return('tmp')
  end

  describe '.output_file' do
    subject { described_class.output_file(directives, &block) }

    let(:directives) { { url: "file:/tmp/12/34/56/7-thumbnail.jpeg" } }
    let(:destination_name) { 'thumbnail' }

    let(:block) { lambda { true } }

    it 'yields to the file' do
      expect(FileUtils).to receive(:mkdir_p).with('/tmp/12/34/56')
      expect(File).to receive(:open).with('/tmp/12/34/56/7-thumbnail.jpeg', 'wb') do |*_, &blk|
        expect(blk).to be(block)
      end
      subject
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.7 spec/services/persist_derivatives_spec.rb
curation_concerns-2.0.0 spec/services/persist_derivatives_spec.rb
curation_concerns-2.0.0.rc2 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.6 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.5 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.4 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.3 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.2 spec/services/persist_derivatives_spec.rb
curation_concerns-2.0.0.rc1 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.1 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.0 spec/services/persist_derivatives_spec.rb
curation_concerns-1.7.0.beta1 spec/services/persist_derivatives_spec.rb
curation_concerns-1.6.3 spec/services/persist_derivatives_spec.rb
curation_concerns-1.6.2 spec/services/persist_derivatives_spec.rb
curation_concerns-1.6.1 spec/services/persist_derivatives_spec.rb
curation_concerns-1.6.0 spec/services/persist_derivatives_spec.rb
curation_concerns-1.5.0 spec/services/persist_derivatives_spec.rb
curation_concerns-1.4.0 spec/services/persist_derivatives_spec.rb
curation_concerns-1.3.3 spec/services/persist_derivatives_spec.rb