Sha256: b2b7f3b17cb7f82dfd38ead9a7c8f6efa2b82da0921597cc6d92e6816d5af0f9

Contents?: true

Size: 1.01 KB

Versions: 9

Compression:

Stored size: 1.01 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::Phonetic.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

9 entries across 9 versions & 1 rubygems

Version Path
picky-2.0.0.pre2 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-2.0.0.pre1 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-1.5.4 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-1.5.3 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-1.5.2 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-1.5.1 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-1.5.0 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-1.4.3 spec/lib/internals/indexing/bundle/super_base_spec.rb
picky-1.4.2 spec/lib/internals/indexing/bundle/super_base_spec.rb