Sha256: c5bcfd1314f14ba643a3f6fb9c6562a2116002231df25f07af365cd034799946

Contents?: true

Size: 808 Bytes

Versions: 14

Compression:

Stored size: 808 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe ThinkingSphinx::Commands::Running do
  let(:command)    { ThinkingSphinx::Commands::Running.new(
    configuration, {}, stream
  ) }
  let(:configuration) {
    double 'configuration', :controller => controller, :settings => {}
  }
  let(:stream)        { double :puts => nil }
  let(:controller)    { double 'controller', :running? => false }

  it 'returns true when Sphinx is running' do
    allow(controller).to receive(:running?).and_return(true)

    expect(command.call).to eq(true)
  end

  it 'returns false when Sphinx is not running' do
    expect(command.call).to eq(false)
  end

  it 'returns true if the flag is set' do
    configuration.settings['skip_running_check'] = true

    expect(command.call).to eq(true)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

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