Sha256: 6d683f21cc02bbd0b7b33389abf186e54fd79c002088464848ac70ed0eb71e5f

Contents?: true

Size: 865 Bytes

Versions: 15

Compression:

Stored size: 865 Bytes

Contents

require 'spec_helper'

describe Index::Bundle do

  before(:each) do
    @configuration = stub :configuration, :identifier => 'some_identifier'
    Index::Files.stub! :new
    @similarity = Similarity::Phonetic.new 3
    @bundle = Index::Bundle.new :some_name, @configuration, @similarity
  end
  
  describe 'similar' do
    before(:each) do
      @bundle.similarity = @similarity.generate_from( :dragon => [1,2,3], :dargon => [4,5,6] )
    end
    it 'returns the right similars (not itself)' do
      @bundle.similar(:dragon).should == [:dargon]
    end
    it 'returns the right similars' do
      @bundle.similar(:trkn).should == [:dragon, :dargon]
    end
    it 'performs' do
      performance_of { @bundle.similar(:dragon) }.should < 0.000075
    end
    it 'performs' do
      performance_of { @bundle.similar(:trkn) }.should < 0.00006
    end
  end
  
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
picky-1.4.1 spec/lib/index/bundle_spec.rb
picky-1.4.0 spec/lib/index/bundle_spec.rb
picky-1.3.4 spec/lib/index/bundle_spec.rb
picky-1.3.3 spec/lib/index/bundle_spec.rb
picky-1.3.2 spec/lib/index/bundle_spec.rb
picky-1.3.1 spec/lib/index/bundle_spec.rb
picky-1.3.0 spec/lib/index/bundle_spec.rb
picky-1.2.4 spec/lib/index/bundle_spec.rb
picky-1.2.3 spec/lib/index/bundle_spec.rb
picky-1.2.2 spec/lib/index/bundle_spec.rb
picky-1.2.1 spec/lib/index/bundle_spec.rb
picky-1.2.0 spec/lib/index/bundle_spec.rb
picky-1.1.7 spec/lib/index/bundle_spec.rb
picky-1.1.6 spec/lib/index/bundle_spec.rb
picky-1.1.5 spec/lib/index/bundle_spec.rb