Sha256: eeb57549b1fd79289717dff9e1920da6c318d2ef7aba1152554c16fd5f74cede
Contents?: true
Size: 1.19 KB
Versions: 24
Compression:
Stored size: 1.19 KB
Contents
# frozen_string_literal: true ############################################################################## # Elasticsearch Plugin ############################################################################## begin require 'elasticsearch-extensions' RSpec.configure do |config| config.before(:suite, :elasticsearch => lambda { |v| !!v }) do Elasticsearch::Extensions::Test::Cluster.start(:port => 9200) unless Elasticsearch::Extensions::Test::Cluster.running? end config.around(:each, :elasticsearch => lambda { |v| !!v }) do |example| model = case example.metadata[:elasticsearch] when String example.metadata[:elasticsearch].constantize end model.__elasticsearch__.client.indices.delete :index => '_all' model.__elasticsearch__.create_index! :index => model.index_name example.run model.__elasticsearch__.client.indices.delete :index => '_all' end config.after(:suite, :elasticsearch => lambda { |v| !!v }) do Elasticsearch::Extensions::Test::Cluster.stop(:port => 9200) if Elasticsearch::Extensions::Test::Cluster.running? end end rescue LoadError end
Version data entries
24 entries across 24 versions & 1 rubygems