Sha256: 63fc37b6b7107e9612f4dc02990a0045080b6e665bb08ac77f3b07ce14794b3b

Contents?: true

Size: 1.59 KB

Versions: 17

Compression:

Stored size: 1.59 KB

Contents

require 'spec_helper'

describe GeoConcerns::Processors::Raster::Base do
  let(:output_file) { 'output/geo.png' }
  let(:file_name) { 'files/geo.tif' }
  let(:label) {}
  let(:options) { { output_size: '150 150', label: label } }

  subject { described_class.new(file_name, {}) }

  describe '#encode' do
    context 'when output label is thumbnail' do
      let(:label) { :thumbnail }
      it 'calls the encode_raster method' do
        expect(subject.class).to receive(:encode_raster)
        subject.class.encode(file_name, options, output_file)
      end
    end

    context 'when output label is display_raster' do
      let(:label) { :display_raster }
      it 'calls the reproject_raster method' do
        expect(subject.class).to receive(:reproject_raster)
        subject.class.encode(file_name, options, output_file)
      end
    end
  end

  describe '#encode_queue' do
    it 'returns an array of command name symbols' do
      expect(subject.class.encode_queue).to include :translate
    end
  end

  describe '#reproject_queue' do
    it 'returns an array of command name symbols' do
      expect(subject.class.reproject_queue).to include :warp
    end
  end

  describe '#encode_raster' do
    it 'runs commands to encode the raster thumbnail' do
      expect(subject.class).to receive(:run_commands)
      subject.class.encode_raster(file_name, options, output_file)
    end
  end

  describe '#reproject_raster' do
    it 'runs commands to reproject the raster' do
      expect(subject.class).to receive(:run_commands)
      subject.class.reproject_raster(file_name, options, output_file)
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
geo_concerns-0.3.4 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.3.3 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.3.2 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.3.1 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.3.0 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.2.0 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.1.1 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.1.0 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.10 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.9 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.8 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.7 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.6 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.5 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.4 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.3 spec/processors/geo_concerns/processors/raster/base_spec.rb
geo_concerns-0.0.2 spec/processors/geo_concerns/processors/raster/base_spec.rb