From afe3974bce8e46b9d137b5578e2addf2c459726f Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 16 Dec 2015 13:04:37 -0800 Subject: Made insecure channel/stub explicit, in all layers --- src/ruby/spec/channel_spec.rb | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'src/ruby/spec/channel_spec.rb') diff --git a/src/ruby/spec/channel_spec.rb b/src/ruby/spec/channel_spec.rb index b4d2b94a81..355f95c9d7 100644 --- a/src/ruby/spec/channel_spec.rb +++ b/src/ruby/spec/channel_spec.rb @@ -45,7 +45,10 @@ describe GRPC::Core::Channel do shared_examples '#new' do it 'take a host name without channel args' do - expect { GRPC::Core::Channel.new('dummy_host', nil) }.not_to raise_error + blk = proc do + GRPC::Core::Channel.new('dummy_host', nil, :this_channel_is_insecure) + end + expect(&blk).not_to raise_error end it 'does not take a hash with bad keys as channel args' do @@ -106,13 +109,15 @@ describe GRPC::Core::Channel do it_behaves_like '#new' def construct_with_args(a) - proc { GRPC::Core::Channel.new('dummy_host', a) } + proc do + GRPC::Core::Channel.new('dummy_host', a, :this_channel_is_insecure) + end end end describe '#create_call' do it 'creates a call OK' do - ch = GRPC::Core::Channel.new(fake_host, nil) + ch = GRPC::Core::Channel.new(fake_host, nil, :this_channel_is_insecure) deadline = Time.now + 5 @@ -123,7 +128,7 @@ describe GRPC::Core::Channel do end it 'raises an error if called on a closed channel' do - ch = GRPC::Core::Channel.new(fake_host, nil) + ch = GRPC::Core::Channel.new(fake_host, nil, :this_channel_is_insecure) ch.close deadline = Time.now + 5 @@ -136,13 +141,13 @@ describe GRPC::Core::Channel do describe '#destroy' do it 'destroys a channel ok' do - ch = GRPC::Core::Channel.new(fake_host, nil) + ch = GRPC::Core::Channel.new(fake_host, nil, :this_channel_is_insecure) blk = proc { ch.destroy } expect(&blk).to_not raise_error end it 'can be called more than once without error' do - ch = GRPC::Core::Channel.new(fake_host, nil) + ch = GRPC::Core::Channel.new(fake_host, nil, :this_channel_is_insecure) blk = proc { ch.destroy } blk.call expect(&blk).to_not raise_error @@ -157,13 +162,13 @@ describe GRPC::Core::Channel do describe '#close' do it 'closes a channel ok' do - ch = GRPC::Core::Channel.new(fake_host, nil) + ch = GRPC::Core::Channel.new(fake_host, nil, :this_channel_is_insecure) blk = proc { ch.close } expect(&blk).to_not raise_error end it 'can be called more than once without error' do - ch = GRPC::Core::Channel.new(fake_host, nil) + ch = GRPC::Core::Channel.new(fake_host, nil, :this_channel_is_insecure) blk = proc { ch.close } blk.call expect(&blk).to_not raise_error -- cgit v1.2.3