Sha256: 10ab9cb102637351447ed2dce7bc5010359944c3f6a8cc61f777e900abf94c15

Contents?: true

Size: 1.11 KB

Versions: 3

Compression:

Stored size: 1.11 KB

Contents

<%- assert_locals service -%>
# frozen_string_literal: true

<%= render partial: "shared/license" %>
require "helper"

require "gapic/grpc/service_stub"

require "<%= service.proto_service_require %>"
require "<%= service.proto_services_require %>"
require "<%= service.service_require %>"

class <%= service.client_name_full %>Test < Minitest::Test
<%= indent render(partial: "service/test/method/setup"), 2 %>

<% service.methods.each do |method| %>
<%= indent render(partial: "service/test/method/#{method.kind}",
                  locals: { method: method }), 2 %>

<% end %>
<%= indent render(partial: "service/test/method/configure", locals: { service: service }), 2 %>
<%- if service.lro? -%>

  def test_<%= service.lro_client_var %>
    grpc_channel = GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure

    client = nil
    Gapic::ServiceStub.stub :new, nil do
      client = <%= service.client_name_full =%>.new do |config|
        config.credentials = grpc_channel
      end
    end

    assert_kind_of <%= service.operations_name_full %>, client.<%= service.lro_client_var %>
  end
<%- end -%>
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gapic-generator-0.6.0 templates/default/service/test/client.erb
gapic-generator-0.5.1 templates/default/service/test/client.erb
gapic-generator-0.5.0 templates/default/service/test/client.erb