Sha256: 5acbbb11378d7c9d034955f71317625d4b1aa829d2684b25e462fd22b87ab358

Contents?: true

Size: 520 Bytes

Versions: 4

Compression:

Stored size: 520 Bytes

Contents

require 'spec_helper'

describe LinkThumbnailer::Grader do

  let(:description) { double('description') }
  let(:instance)    { described_class.new(description) }

  describe '#call' do

    let(:probability)   { 0.5 }
    let(:grader)  { double('grader', call: probability) }
    let(:lambda)  { ->(_) { grader } }
    let(:graders) { [lambda, lambda] }
    let(:action)  { instance.call }

    before do
      instance.stub(:graders).and_return(graders)
    end

    it { expect(action).to eq(0.5 * 0.5) }

  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
link_thumbnailer-3.0.3 spec/grader_spec.rb
link_thumbnailer-3.0.2 spec/grader_spec.rb
link_thumbnailer-3.0.1 spec/grader_spec.rb
link_thumbnailer-3.0.0 spec/grader_spec.rb