Sha256: 4559115089e127d5d70eecf31c8fe4affc244150bc9c44eb4cff39058f6049ca
Contents?: true
Size: 1.18 KB
Versions: 14
Compression:
Stored size: 1.18 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
14 entries across 14 versions & 1 rubygems