aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/spec/generic/rpc_server_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/spec/generic/rpc_server_spec.rb')
-rw-r--r--src/ruby/spec/generic/rpc_server_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ruby/spec/generic/rpc_server_spec.rb b/src/ruby/spec/generic/rpc_server_spec.rb
index 44a6134086..924d747a79 100644
--- a/src/ruby/spec/generic/rpc_server_spec.rb
+++ b/src/ruby/spec/generic/rpc_server_spec.rb
@@ -342,6 +342,28 @@ describe GRPC::RpcServer do
t.join
end
+ it 'should return UNIMPLEMENTED on unimplemented ' \
+ 'methods for client_streamer', server: true do
+ @srv.handle(EchoService)
+ t = Thread.new { @srv.run }
+ @srv.wait_till_running
+ blk = proc do
+ stub = EchoStub.new(@host, :this_channel_is_insecure, **client_opts)
+ requests = [EchoMsg.new, EchoMsg.new]
+ stub.a_client_streaming_rpc_unimplemented(requests)
+ end
+
+ begin
+ expect(&blk).to raise_error do |error|
+ expect(error).to be_a(GRPC::BadStatus)
+ expect(error.code).to eq(GRPC::Core::StatusCodes::UNIMPLEMENTED)
+ end
+ ensure
+ @srv.stop # should be call not to crash
+ t.join
+ end
+ end
+
it 'should handle multiple sequential requests', server: true do
@srv.handle(EchoService)
t = Thread.new { @srv.run }