Sha256: 27f020423d25218baced4621412c0d666256def23e3005ca0583b89c0c4df88e

Contents?: true

Size: 892 Bytes

Versions: 11

Compression:

Stored size: 892 Bytes

Contents

require 'spec_helper'

describe Indexers::Parallel do

  before(:each) do
    @source     = stub :source
    @tokenizer  = stub :tokenizer
    @categories = stub :categories
    @index      = stub :index, :name => :some_index, :categories => @categories
    
    @indexer = described_class.new @index
    @indexer.stub! :timed_exclaim
  end
  
  describe 'flush' do
    it 'flushes to joined cache to the file and clears it' do
      cache = stub :cache
      file  = stub :file
      
      cache.should_receive(:join).twice.and_return :joined
      file.should_receive(:write).twice.with(:joined).and_return :joined
      cache.should_receive(:clear).twice
      
      @indexer.flush [[nil, cache, file], [nil, cache, file]]
    end
  end
  
  describe "index" do
    it "should process" do
      @indexer.should_receive(:process).once.with
      
      @indexer.index
    end
  end
  
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
picky-2.6.0 spec/lib/indexers/parallel_spec.rb
picky-2.5.2 spec/lib/internals/indexers/parallel_spec.rb
picky-2.5.1 spec/lib/internals/indexers/parallel_spec.rb
picky-2.5.0 spec/lib/internals/indexers/parallel_spec.rb
picky-2.4.3 spec/lib/internals/indexers/parallel_spec.rb
picky-2.4.2 spec/lib/internals/indexers/parallel_spec.rb
picky-2.4.1 spec/lib/internals/indexers/parallel_spec.rb
picky-2.4.0 spec/lib/internals/indexers/parallel_spec.rb
picky-2.3.0 spec/lib/internals/indexers/parallel_spec.rb
picky-2.2.1 spec/lib/internals/indexers/parallel_spec.rb
picky-2.2.0 spec/lib/internals/indexers/parallel_spec.rb