Sha256: 0d2d7106f33bb8a30f1f9c15f98626cc5e916697d51e4088fd214f2c12dc9536

Contents?: true

Size: 649 Bytes

Versions: 6

Compression:

Stored size: 649 Bytes

Contents

module SphinxHelpers
  def sphinx
    @sphinx ||= SphinxController.new
  end

  def index(*indices)
    sleep 0.5 if ENV['TRAVIS']

    yield if block_given?

    sphinx.index *indices
    sleep 0.25
    sleep 0.5 if ENV['TRAVIS']
  end
end

RSpec.configure do |config|
  config.include SphinxHelpers

  config.before :all do |group|
    FileUtils.rm_rf ThinkingSphinx::Configuration.instance.indices_location
    FileUtils.rm_rf ThinkingSphinx::Configuration.instance.searchd.binlog_path

    sphinx.setup && sphinx.start if group.class.metadata[:live]
  end

  config.after :all do |group|
    sphinx.stop if group.class.metadata[:live]
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
thinking-sphinx-3.2.0 spec/acceptance/support/sphinx_helpers.rb
thinking-sphinx-3.1.4 spec/acceptance/support/sphinx_helpers.rb
thinking-sphinx-3.1.3 spec/acceptance/support/sphinx_helpers.rb
thinking-sphinx-3.1.2 spec/acceptance/support/sphinx_helpers.rb
thinking-sphinx-3.1.1 spec/acceptance/support/sphinx_helpers.rb
thinking-sphinx-3.1.0 spec/acceptance/support/sphinx_helpers.rb