Sha256: 87d627441b36ff53cdedc4a4630a90adf4a41a676c847e382ea5da1d4c58723b

Contents?: true

Size: 1018 Bytes

Versions: 12

Compression:

Stored size: 1018 Bytes

Contents

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

12 entries across 12 versions & 1 rubygems

Version Path
elasticsearch-api-6.8.3 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.8.2 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.8.1 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.8.0 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.3.1 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.3.0 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.2.0 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.1.0 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.0.3 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.0.2 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.0.1 utils/thor/templates/ruby/test.erb
elasticsearch-api-6.0.0 utils/thor/templates/ruby/test.erb