Sha256: 9992139ef2034b6f734076c8e265f8c056ee3a592d1322adf9ab4d8ecde11b04

Contents?: true

Size: 1.23 KB

Versions: 6

Compression:

Stored size: 1.23 KB

Contents

require 'test_helper'

module Elasticsearch
  module Test
    class ClusterNodeHotThreadsTest < ::Test::Unit::TestCase

      context "Cluster: Node hot threads" do
        subject { FakeClient.new }

        should "perform correct request" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'GET', method
            assert_equal '_nodes/hot_threads', url
            assert_equal Hash.new, params
            assert_nil   body
            true
          end.returns(FakeResponse.new)

          subject.cluster.node_hot_threads
        end

        should "send :node_id correctly" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal '_nodes/foo/hot_threads', url
            true
          end.returns(FakeResponse.new)

          subject.cluster.node_hot_threads :node_id => 'foo'
        end

        should "URL-escape the parts" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal '_nodes/foo%5Ebar/hot_threads', url
            true
          end.returns(FakeResponse.new)

          subject.cluster.node_hot_threads :node_id => 'foo^bar'
        end

      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
elasticsearch-api-0.4.11 test/unit/cluster/node_hot_threads_test.rb
elasticsearch-api-0.4.10 test/unit/cluster/node_hot_threads_test.rb
elasticsearch-api-0.4.9 test/unit/cluster/node_hot_threads_test.rb
elasticsearch-api-0.4.8 test/unit/cluster/node_hot_threads_test.rb
elasticsearch-api-0.4.7 test/unit/cluster/node_hot_threads_test.rb
elasticsearch-api-0.4.6 test/unit/cluster/node_hot_threads_test.rb