diff options
Diffstat (limited to 'src/ruby/spec/server_spec.rb')
-rw-r--r-- | src/ruby/spec/server_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ruby/spec/server_spec.rb b/src/ruby/spec/server_spec.rb index 47fe575343..439b19fb8d 100644 --- a/src/ruby/spec/server_spec.rb +++ b/src/ruby/spec/server_spec.rb @@ -32,7 +32,8 @@ require 'grpc' def load_test_certs test_root = File.join(File.dirname(__FILE__), 'testdata') files = ['ca.pem', 'server1.key', 'server1.pem'] - files.map { |f| File.open(File.join(test_root, f)).read } + contents = files.map { |f| File.open(File.join(test_root, f)).read } + [contents[0], [{ private_key: contents[1], cert_chain: contents[2] }], false] end Server = GRPC::Core::Server @@ -104,7 +105,7 @@ describe Server do it 'runs without failing' do blk = proc do s = Server.new(@cq, nil) - s.add_http2_port('localhost:0') + s.add_http2_port('localhost:0', :this_port_is_insecure) s.close(@cq) end expect(&blk).to_not raise_error @@ -113,7 +114,10 @@ describe Server do it 'fails if the server is closed' do s = Server.new(@cq, nil) s.close(@cq) - expect { s.add_http2_port('localhost:0') }.to raise_error(RuntimeError) + blk = proc do + s.add_http2_port('localhost:0', :this_port_is_insecure) + end + expect(&blk).to raise_error(RuntimeError) end end @@ -198,7 +202,7 @@ describe Server do def start_a_server s = Server.new(@cq, nil) - s.add_http2_port('0.0.0.0:0') + s.add_http2_port('0.0.0.0:0', :this_port_is_insecure) s.start s end |