Sha256: ce5a391d7eaa75d3e4960b3692b32ed69731c321f4ba3e3ae0a4e9e970ec47c7

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents

require 'test_helper'
require 'pathname'

require 'elasticsearch/extensions/test/cluster'

class Elasticsearch::Extensions::TestClusterIntegrationTest < Test::Unit::TestCase
  context "The Test::Cluster" do
    PATH_TO_BUILDS = Pathname(File.expand_path('../../../../../../tmp/builds', __FILE__))

    unless PATH_TO_BUILDS.exist?
      puts "Path to builds doesn't exist, skipping TestClusterIntegrationTest"
      exit(0)
    end

    @builds = begin
      PATH_TO_BUILDS.entries.reject { |f| f.to_s =~ /^\./ }
    rescue Errno::ENOENT
      []
    end

    @builds.each do |build|
      should "start and stop #{build.to_s}" do
        puts ("----- #{build.to_s} " + "-"*(80-7-build.to_s.size)).to_s.ansi(:bold)
        Elasticsearch::Extensions::Test::Cluster.start command: PATH_TO_BUILDS.join(build.join('bin/elasticsearch')).to_s

        # Index some data to create the data directory
        client = Elasticsearch::Client.new host: "localhost:9250"
        client.index index: 'test1', type: 'd', id: 1, body: { title: 'TEST' }

        Elasticsearch::Extensions::Test::Cluster.stop command: PATH_TO_BUILDS.join(build.join('bin/elasticsearch')).to_s
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
elasticsearch-extensions-0.0.26 test/test/cluster/integration/cluster_test.rb
elasticsearch-extensions-0.0.25 test/test/cluster/integration/cluster_test.rb
elasticsearch-extensions-0.0.24 test/test/cluster/integration/cluster_test.rb
elasticsearch-extensions-0.0.23 test/test/cluster/integration/cluster_test.rb