Sha256: e20884c6207cac946b2ec70e251a715b2f887c9ae8d08b11b4367cc62d257aeb

Contents?: true

Size: 742 Bytes

Versions: 2

Compression:

Stored size: 742 Bytes

Contents

require File.expand_path('../spec_helper', __FILE__)
require File.expand_path('../mock/position', __FILE__)

include DCA::Mock

describe 'ElasticSearch storage' do
  let(:connection) { @connection ||= DCA::ElasticSearchStorage.establish_connection APP_CONFIG[:elascticseach_db] }
  let(:position) { ElasticSearchPosition.new :base_id => '0', :checksum => '0'}
  let(:storage) { @storage ||= DCA::ElasticSearchStorage.new connection, position.class, :index => 'test' }

  before :all do
    connection
    storage.index do
      create
      store :type => 'position', :base_id => '1', :checksum => '1'
      refresh
    end
  end

  after :all do
    storage.index do
      delete
      refresh
    end
  end

  it_behaves_like 'storage'
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dca-0.1.1 spec/elasticsearch_storage_spec.rb
dca-0.1.0 spec/elasticsearch_storage_spec.rb