Sha256: 94e24e2d8a3621fe44d33e8f4df96cb22fba72b3196035e96d476dd6899b75d7

Contents?: true

Size: 1.75 KB

Versions: 46

Compression:

Stored size: 1.75 KB

Contents

# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.

require 'test_helper'

module Elasticsearch
  module Test
    class <%= @module_namespace.map {|n| n.capitalize}.map { |n| n == 'Xpack' ? 'XPack' : n  }.join('') + @method_name.camelize %>Test < ::Test::Unit::TestCase

      context "<%= @module_namespace.map {|n| n.capitalize}.map { |n| n == 'Xpack' ? 'XPack' : n  }.join(' ') + ': ' %><%= @method_name.humanize %>" do
        subject { FakeClient.new }

        should "perform correct request" do
          subject.expects(:perform_request).with do |method, url, params, body|
            assert_equal 'FAKE', method
            assert_equal 'test', url
            assert_equal Hash.new, params
            <%= @spec['body'].nil? ? 'assert_nil   body' : 'assert_equal Hash.new, body' %>
            true
          end.returns(FakeResponse.new)

          subject.<%= @full_namespace.join('.') %> <%= @spec['url']['parts'].select { |name, info| info['required'] }.keys.map { |d| ":#{d} => 'foo'" }.join(', ') rescue '' %>
        end

      end

    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
elasticsearch-api-8.16.1 utils/thor/templates/test.erb
elasticsearch-api-8.17.1 utils/thor/templates/test.erb
elasticsearch-api-8.17.0 utils/thor/templates/test.erb
elasticsearch-api-8.16.0 utils/thor/templates/test.erb
elasticsearch-api-8.15.0 utils/thor/templates/test.erb
elasticsearch-api-8.14.0 utils/thor/templates/test.erb
elasticsearch-api-7.17.11 utils/thor/templates/test.erb
elasticsearch-api-8.13.0 utils/thor/templates/test.erb
elasticsearch-api-8.12.2 utils/thor/templates/test.erb
elasticsearch-api-8.11.2 utils/thor/templates/test.erb
elasticsearch-api-8.12.1 utils/thor/templates/test.erb
elasticsearch-api-8.11.1 utils/thor/templates/test.erb
elasticsearch-api-8.12.0 utils/thor/templates/test.erb
elasticsearch-api-8.11.0 utils/thor/templates/test.erb
elasticsearch-api-7.17.10 utils/thor/templates/test.erb
elasticsearch-api-7.17.9 utils/thor/templates/test.erb
elasticsearch-api-8.10.0 utils/thor/templates/test.erb
elasticsearch-api-7.17.8 utils/thor/templates/test.erb
elasticsearch-api-8.9.0 utils/thor/templates/test.erb
elasticsearch-api-8.8.0 utils/thor/templates/test.erb