Sha256: 7c29563d5d57b173c28af337ee9d896ea6c715d07f30a3d503e07f26d016fd97

Contents?: true

Size: 1.63 KB

Versions: 8

Compression:

Stored size: 1.63 KB

Contents

# Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information

require 'spec_helper'

describe 'client.nodes#info' do

  let(:expected_args) do
    [
        'GET',
        url,
        params,
        nil,
        nil
    ]
  end

  let(:url) do
    '_nodes'
  end

  it 'performs the request' do
    expect(client_double.nodes.info).to eq({})
  end

  let(:params) do
    {}
  end

  context 'when the node id is specified' do

    let(:url) do
      '_nodes/foo'
    end

    it 'performs the request' do
      expect(client_double.nodes.info(node_id: 'foo')).to eq({})
    end
  end

  context 'when multiple node ids are specified as a list' do

    let(:url) do
      '_nodes/A,B,C'
    end

    it 'performs the request' do
      expect(client_double.nodes.info(node_id: ['A', 'B', 'C'])).to eq({})
    end
  end

  context 'when multiple node ids are specified as a String' do

    let(:url) do
      '_nodes/A,B,C'
    end

    it 'performs the request' do
      expect(client_double.nodes.info(node_id: 'A,B,C')).to eq({})
    end
  end

  context 'when URL params are specified' do

    let(:url) do
      '_nodes'
    end

    let(:params) do
      { format: 'yaml' }
    end

    it 'performs the request' do
      expect(client_double.nodes.info(format: 'yaml')).to eq({})
    end
  end

  context 'when metrics are specified' do

    let(:url) do
      '_nodes/http,network'
    end

    it 'performs the request' do
      expect(client_double.nodes.info(metric: ['http', 'network'])).to eq({})
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
elasticsearch-api-6.8.3 spec/elasticsearch/api/actions/nodes/info_spec.rb
elasticsearch-api-6.8.2 spec/elasticsearch/api/actions/nodes/info_spec.rb
elasticsearch-api-7.6.0 spec/elasticsearch/api/actions/nodes/info_spec.rb
elasticsearch-api-7.6.0.pre spec/elasticsearch/api/actions/nodes/info_spec.rb
elasticsearch-api-7.5.0 spec/elasticsearch/api/actions/nodes/info_spec.rb
elasticsearch-api-7.5.0.pre.pre spec/elasticsearch/api/actions/nodes/info_spec.rb
elasticsearch-api-7.4.0 spec/elasticsearch/api/actions/nodes/info_spec.rb
elasticsearch-api-7.3.0 spec/elasticsearch/api/actions/nodes/info_spec.rb