Sha256: 12260dd85d64ffa53611dd51e870c84717d8956fc7c1f31259cea62302e7198f

Contents?: true

Size: 697 Bytes

Versions: 23

Compression:

Stored size: 697 Bytes

Contents

require 'spec_helper'

describe LinkThumbnailer::ImageComparators::Size do

  let(:image)     { double(size: [20, 20]) }
  let(:instance)  { described_class.new(image) }

  describe '#call' do

    let(:other)   { double(size: other_size) }
    let(:action)  { instance.call(other) }

    context 'when other has a better image' do

      let(:other_size) { [10, 10] }

      it { expect(action).to eq(-1) }

    end

    context 'when other has an identical image' do

      let(:other_size) { [20, 20] }

      it { expect(action).to eq(0) }

    end

    context 'when other has a weaker image' do

      let(:other_size) { [30, 30] }

      it { expect(action).to eq(1) }

    end

  end

end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
link_thumbnailer-3.0.3 spec/image_comparators/size_spec.rb
link_thumbnailer-3.0.2 spec/image_comparators/size_spec.rb
link_thumbnailer-3.0.1 spec/image_comparators/size_spec.rb
link_thumbnailer-3.0.0 spec/image_comparators/size_spec.rb
link_thumbnailer-2.6.1 spec/image_comparators/size_spec.rb
link_thumbnailer-2.6.0 spec/image_comparators/size_spec.rb
link_thumbnailer-2.5.2 spec/image_comparators/size_spec.rb
link_thumbnailer-2.5.1 spec/image_comparators/size_spec.rb
link_thumbnailer-2.5.0 spec/image_comparators/size_spec.rb
link_thumbnailer-2.4.0 spec/image_comparators/size_spec.rb
link_thumbnailer-2.3.2 spec/image_comparators/size_spec.rb
link_thumbnailer-2.3.1 spec/image_comparators/size_spec.rb
link_thumbnailer-2.3.0 spec/image_comparators/size_spec.rb
link_thumbnailer-2.2.3 spec/image_comparators/size_spec.rb
link_thumbnailer-2.2.2 spec/image_comparators/size_spec.rb
link_thumbnailer-2.2.1 spec/image_comparators/size_spec.rb
link_thumbnailer-2.2.0 spec/image_comparators/size_spec.rb
link_thumbnailer-2.1.0 spec/image_comparators/size_spec.rb
link_thumbnailer-2.0.4 spec/image_comparators/size_spec.rb
link_thumbnailer-2.0.3 spec/image_comparators/size_spec.rb