Sha256: 4690ab9412e83ab88f051f5d146d8dc993ea734fcded9be19e916f818dd14224

Contents?: true

Size: 1.19 KB

Versions: 6

Compression:

Stored size: 1.19 KB

Contents

require 'spec/spec_helper'

describe ThinkingSphinx::Deltas::DeltaJob do
  describe '#perform' do
    before :each do
      ThinkingSphinx.suppress_delta_output = false
      
      @delta_job = ThinkingSphinx::Deltas::DeltaJob.new(['foo_core'])
      @delta_job.stub! :`    => true
      @delta_job.stub! :puts => nil
    end
    
    it "should output the delta indexing by default" do
      @delta_job.should_receive(:puts)
      
      @delta_job.perform
    end
    
    it "should not output the delta indexing if requested" do
      ThinkingSphinx.suppress_delta_output = true
      @delta_job.should_not_receive(:puts)
      
      @delta_job.perform
    end
    
    it "should process just the requested indexes" do
      @delta_job.should_receive(:`) do |command|
        command.should match(/foo_core/)
        command.should_not match(/--all/)
      end
      
      @delta_job.perform
    end
    
    context 'multiple indexes' do
      it "should process all requested indexes" do
        @delta_job.indexes = ['foo_core', 'bar_core']
        @delta_job.should_receive(:`) do |command|
          command.should match(/foo_core bar_core/)
        end

        @delta_job.perform
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
ts-delayed-delta-1.0.3 spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb
namxam-ts-delayed-delta-1.0.3 spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb
warp-ts-delayed-delta-1.0.3 spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb
warp-ts-delayed-delta-1.0.2 spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb
ts-delayed-delta-1.0.2 spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb
ts-delayed-delta-1.0.1 spec/thinking_sphinx/deltas/delayed_delta/delta_job_spec.rb