diff options
Diffstat (limited to 'src/ruby/spec/pb')
-rw-r--r-- | src/ruby/spec/pb/health/checker_spec.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/ruby/spec/pb/health/checker_spec.rb b/src/ruby/spec/pb/health/checker_spec.rb index 322566b784..c1decd822a 100644 --- a/src/ruby/spec/pb/health/checker_spec.rb +++ b/src/ruby/spec/pb/health/checker_spec.rb @@ -1,4 +1,4 @@ -# Copyright 2015, Google Inc. +# Copyright 2015-2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -47,13 +47,12 @@ describe 'Health protobuf code generation' do end it 'should have the same content as created by code generation' do - root_dir = File.dirname( - File.dirname(File.dirname(File.dirname(__FILE__)))) - pb_dir = File.join(root_dir, 'pb') + root_dir = File.join(File.dirname(__FILE__), '..', '..', '..', '..') + pb_dir = File.join(root_dir, 'proto') # Get the current content - service_path = File.join(pb_dir, 'grpc', 'health', 'v1alpha', - 'health_services.rb') + service_path = File.join(root_dir, 'ruby', 'pb', 'grpc', + 'health', 'v1alpha', 'health_services.rb') want = nil File.open(service_path) { |f| want = f.read } @@ -188,7 +187,7 @@ describe Grpc::Health::Checker do @server = GRPC::Core::Server.new(@server_queue, nil) server_port = @server.add_http2_port(server_host, :this_port_is_insecure) @host = "localhost:#{server_port}" - @ch = GRPC::Core::Channel.new(@host, nil) + @ch = GRPC::Core::Channel.new(@host, nil, :this_channel_is_insecure) @client_opts = { channel_override: @ch } server_opts = { server_override: @server, @@ -208,7 +207,7 @@ describe Grpc::Health::Checker do t = Thread.new { @srv.run } @srv.wait_till_running - stub = CheckerStub.new(@host, **@client_opts) + stub = CheckerStub.new(@host, :this_channel_is_insecure, **@client_opts) got = stub.check(HCReq.new) want = HCResp.new(status: ServingStatus::NOT_SERVING) expect(got).to eq(want) @@ -221,7 +220,7 @@ describe Grpc::Health::Checker do t = Thread.new { @srv.run } @srv.wait_till_running blk = proc do - stub = CheckerStub.new(@host, **@client_opts) + stub = CheckerStub.new(@host, :this_channel_is_insecure, **@client_opts) stub.check(HCReq.new(host: 'unknown', service: 'unknown')) end expected_msg = /#{StatusCodes::NOT_FOUND}/ |