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-0.14.0.pre3 spec/services/persist_derivatives_spec.rb
curation_concerns-0.14.0.pre2 spec/services/persist_derivatives_spec.rb
curation_concerns-0.14.0.pre1 spec/services/persist_derivatives_spec.rb
curation_concerns-0.13.1 spec/services/persist_derivatives_spec.rb
curation_concerns-0.13.0 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre9 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre8 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre7 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre6 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre5 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre4 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre3 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre2 spec/services/persist_derivatives_spec.rb
curation_concerns-0.12.0.pre1 spec/services/persist_derivatives_spec.rb
curation_concerns-0.11.0 spec/services/persist_derivatives_spec.rb
curation_concerns-0.11.0.rc1 spec/services/persist_derivatives_spec.rb
curation_concerns-0.10.0 spec/services/persist_derivatives_spec.rb
curation_concerns-0.9.0 spec/services/persist_derivatives_spec.rb
curation_concerns-0.8.0 spec/services/persist_derivatives_spec.rb