Sha256: ae74588830580da5070aed6ef37e0a35c5ad05987422fc000b59ce8962d87bcd

Contents?: true

Size: 1.02 KB

Versions: 15

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe Internals::Indexing::Bundle::SuperBase do

  before(:each) do
    @configuration = stub :configuration, :identifier => 'some_identifier'
    Internals::Index::Files.stub! :new
    @similarity = Similarity::DoubleMetaphone.new 3
    @bundle = described_class.new :some_name, @configuration, @similarity
  end
  
  describe 'identifier' do
    it 'is correct' do
      @bundle.identifier.should == 'some_identifier:some_name'
    end
  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-2.5.2 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.5.1 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.5.0 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.4.3 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.4.2 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.4.1 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.4.0 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.3.0 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.2.1 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.2.0 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.1.2 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.1.1 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.1.0 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.0.0 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.0.0.pre3 spec/lib/internals/indexing/bundle/super_base_spec.rb