Sha256: 406811d5ff9f7c083fc2e3f7f5f641c1677a452446f491fad33a7d74cfd2337d
Contents?: true
Size: 734 Bytes
Versions: 21
Compression:
Stored size: 734 Bytes
Contents
require 'spec_helper' describe LinkThumbnailer::ImageParsers::Size do describe '.perform' do let(:size) { [10, 10] } let(:src) { 'http://foo.com' } let(:image) { double(src: src) } let(:action) { described_class.perform(image) } context 'when no exception is raised' do before do expect(FastImage).to receive(:size).with(src, raise_on_failure: true).and_return(size) end it { expect(action).to eq(size) } end context 'when an exception is raised' do before do expect(FastImage).to receive(:size).with(src, raise_on_failure: true).and_raise(FastImage::FastImageException) end it { expect(action).to eq([0, 0]) } end end end
Version data entries
21 entries across 21 versions & 1 rubygems