Sha256: ea9491ed8a9a0bc2f86574b7f4e911c8c03a5df3d93d37cb0e8fe26f0cb672c3

Contents?: true

Size: 1002 Bytes

Versions: 17

Compression:

Stored size: 1002 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ThinkingSphinx::Commands::IndexRealTime do
  let(:command)       { ThinkingSphinx::Commands::IndexRealTime.new(
    configuration, {:indices => [users_index, parts_index]}, stream
  ) }
  let(:configuration) { double 'configuration', :controller => controller }
  let(:controller)    { double 'controller', :rotate => nil }
  let(:stream)        { double :puts => nil }
  let(:users_index)   { double(name: 'users') }
  let(:parts_index)   { double(name: 'parts') }

  before :each do
    allow(ThinkingSphinx::RealTime::Populator).to receive(:populate)
  end

  it 'populates each real-index' do
    expect(ThinkingSphinx::RealTime::Populator).to receive(:populate).
      with(users_index)
    expect(ThinkingSphinx::RealTime::Populator).to receive(:populate).
      with(parts_index)

    command.call
  end

  it "rotates the daemon for each index" do
    expect(controller).to receive(:rotate).twice

    command.call
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
thinking-sphinx-5.6.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.5.1 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.5.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.4.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.3.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.2.1 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.2.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.1.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-5.0.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.4.1 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.4.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.3.2 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.3.1 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.3.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.2.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.1.0 spec/thinking_sphinx/commands/index_real_time_spec.rb
thinking-sphinx-4.0.0 spec/thinking_sphinx/commands/index_real_time_spec.rb