aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby
diff options
context:
space:
mode:
authorGravatar Tim Emiola <temiola@google.com>2015-01-26 18:29:51 -0800
committerGravatar Tim Emiola <temiola@google.com>2015-01-26 18:44:59 -0800
commitf875aa36982970144df62de996ed48a80b1d4c37 (patch)
treefae1c438059234562bcc00a50e188a3e5aedbe1b /src/ruby
parenta8ecbe9a10e02bef17cb9a5aed094a93b56bd906 (diff)
Removed port_picker from active_call_spec, fixed some style issues
Diffstat (limited to 'src/ruby')
-rw-r--r--src/ruby/lib/grpc/generic/active_call.rb2
-rw-r--r--src/ruby/spec/generic/active_call_spec.rb10
2 files changed, 5 insertions, 7 deletions
diff --git a/src/ruby/lib/grpc/generic/active_call.rb b/src/ruby/lib/grpc/generic/active_call.rb
index 1cdc168bfe..6c2b6e91c2 100644
--- a/src/ruby/lib/grpc/generic/active_call.rb
+++ b/src/ruby/lib/grpc/generic/active_call.rb
@@ -67,7 +67,7 @@ module Google
fail(ArgumentError, 'not a CompletionQueue')
end
call.add_metadata(kw) if kw.length > 0
- invoke_accepted, client_metadata_read = Object.new, Object.new
+ client_metadata_read = Object.new
finished_tag = Object.new
call.invoke(q, client_metadata_read, finished_tag)
[finished_tag, client_metadata_read]
diff --git a/src/ruby/spec/generic/active_call_spec.rb b/src/ruby/spec/generic/active_call_spec.rb
index 443ba3d192..e81b2168b0 100644
--- a/src/ruby/spec/generic/active_call_spec.rb
+++ b/src/ruby/spec/generic/active_call_spec.rb
@@ -28,7 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
require 'grpc'
-require_relative '../port_picker'
include GRPC::Core::StatusCodes
@@ -45,12 +44,11 @@ describe GRPC::ActiveCall do
@client_queue = GRPC::Core::CompletionQueue.new
@server_queue = GRPC::Core::CompletionQueue.new
- port = find_unused_tcp_port
- host = "localhost:#{port}"
+ host = '0.0.0.0:0'
@server = GRPC::Core::Server.new(@server_queue, nil)
- @server.add_http2_port(host)
+ server_port = @server.add_http2_port(host)
@server.start
- @ch = GRPC::Core::Channel.new(host, nil)
+ @ch = GRPC::Core::Channel.new("localhost:#{server_port}", nil)
end
after(:each) do
@@ -206,7 +204,7 @@ describe GRPC::ActiveCall do
it 'get a nil msg before a status when an OK status is sent' do
call = make_test_call
done_tag, meta_tag = ActiveCall.client_invoke(call, @client_queue,
- deadline)
+ deadline)
client_call = ActiveCall.new(call, @client_queue, @pass_through,
@pass_through, deadline,
finished_tag: done_tag,