Sha256: 5b2dfc1412393c604466dfee3bba9d4ee23412a97c17399e42bdb9a2552f4a22
Contents?: true
Size: 1.08 KB
Versions: 18
Compression:
Stored size: 1.08 KB
Contents
require 'spec_helper' describe GeoConcerns::Processors::Zip do before do class TestProcessor include Hydra::Derivatives::Processors::ShellBasedProcessor include GeoConcerns::Processors::Zip end end after { Object.send(:remove_const, :TestProcessor) } subject { TestProcessor.new } let(:path) { 'files/test.zip' } let(:output_file) { 'output/test.tif' } describe '#unzip' do let(:command) { 'unzip -qq -j -d "output/test_out" "files/test.zip"' } context 'given an input and output path' do it 'runs an unzip command and yields to a block' do arg = '' expect(subject.class).to receive(:execute).with(command) expect(FileUtils).to receive(:rm_rf) subject.class.unzip(path, output_file) { |a| arg = a } expect(arg).to eq('output/test_out') end end end describe '#zip' do let(:command) { 'zip -j -qq -r "output/test.tif" "files/test.zip"' } it 'runs a zip command ' do expect(subject.class).to receive(:execute).with(command) subject.class.zip(path, output_file) end end end
Version data entries
18 entries across 18 versions & 1 rubygems