Sha256: fac9f0ab00d6342fac938779057e46c237f40b870cd073ed0a56b9810a62cd5c
Contents?: true
Size: 833 Bytes
Versions: 10
Compression:
Stored size: 833 Bytes
Contents
require 'spec_helper' describe LinkThumbnailer::Graders::LinkDensity do let(:description) { double('description') } let(:instance) { described_class.new(description) } describe '#call' do let(:action) { instance.call } before do instance.stub(:text).and_return(text) instance.stub(:links).and_return(links) end context 'when text length is 0' do let(:text) { '' } let(:links) { [] } it { expect(action).to eq(0.0) } end context 'when text length is > 0' do let(:text) { 'foo' } context 'and links is 0' do let(:links) { [] } it { expect(action).to eq(1.0) } end context 'and links is > 0' do let(:links) { [1] } it { expect(action).to be_within(0.001).of(0.666) } end end end end
Version data entries
10 entries across 10 versions & 1 rubygems