From 74878c7bf577b4cfea1d2f52ed0661a676961c17 Mon Sep 17 00:00:00 2001 From: Muxi Yan Date: Tue, 3 Oct 2017 15:49:09 -0700 Subject: [PATCH] Another Ruby build fix --- src/ruby/pb/test/client.rb | 2 +- src/ruby/spec/compression_options_spec.rb | 24 +++++++++++------------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ruby/pb/test/client.rb b/src/ruby/pb/test/client.rb index a110fec960e..4f2275e32aa 100755 --- a/src/ruby/pb/test/client.rb +++ b/src/ruby/pb/test/client.rb @@ -102,7 +102,7 @@ def create_stub(opts) if ['client_compressed_unary', 'client_compressed_streaming'].include?(opts.test_case) compression_options = - GRPC::Core::CompressionOptions.new(default_algorithm: :gzip) + GRPC::Core::CompressionOptions.new(default_algorithm: :message/gzip) compression_channel_args = compression_options.to_channel_arg_hash else compression_channel_args = {} diff --git a/src/ruby/spec/compression_options_spec.rb b/src/ruby/spec/compression_options_spec.rb index 03c3cd9f072..dc9c41c5801 100644 --- a/src/ruby/spec/compression_options_spec.rb +++ b/src/ruby/spec/compression_options_spec.rb @@ -19,7 +19,7 @@ describe GRPC::Core::CompressionOptions do # according to what the core lib provides. # Names of supported compression algorithms - ALGORITHMS = [:identity, :deflate, :gzip] + ALGORITHMS = [:identity, :message/deflate, :message/gzip] # Names of valid supported compression levels COMPRESS_LEVELS = [:none, :low, :medium, :high] @@ -54,10 +54,10 @@ describe GRPC::Core::CompressionOptions do options = GRPC::Core::CompressionOptions.new( default_algorithm: :identity, default_level: :none, - disabled_algorithms: [:gzip, :deflate] + disabled_algorithms: [:message/gzip, :message/deflate] ) - [:gzip, :deflate].each do |algorithm| + [:message/gzip, :message/deflate].each do |algorithm| expect(options.algorithm_enabled?(algorithm)).to be false expect(options.disabled_algorithms.include?(algorithm)).to be true end @@ -69,16 +69,16 @@ describe GRPC::Core::CompressionOptions do it 'works when all optional args have been set' do options = GRPC::Core::CompressionOptions.new( - default_algorithm: :gzip, + default_algorithm: :message/gzip, default_level: :low, - disabled_algorithms: [:deflate] + disabled_algorithms: [:message/deflate] ) - expect(options.algorithm_enabled?(:deflate)).to be false - expect(options.algorithm_enabled?(:gzip)).to be true - expect(options.disabled_algorithms).to eq([:deflate]) + expect(options.algorithm_enabled?(:message/deflate)).to be false + expect(options.algorithm_enabled?(:message/gzip)).to be true + expect(options.disabled_algorithms).to eq([:message/deflate]) - expect(options.default_algorithm).to be(:gzip) + expect(options.default_algorithm).to be(:message/gzip) expect(options.default_level).to be(:low) expect(options.to_hash).to be_instance_of(Hash) end @@ -102,12 +102,12 @@ describe GRPC::Core::CompressionOptions do describe '#new with bad parameters' do it 'should fail with more than one parameter' do - blk = proc { GRPC::Core::CompressionOptions.new(:gzip, :none) } + blk = proc { GRPC::Core::CompressionOptions.new(:message/gzip, :none) } expect { blk.call }.to raise_error end it 'should fail with a non-hash parameter' do - blk = proc { GRPC::Core::CompressionOptions.new(:gzip) } + blk = proc { GRPC::Core::CompressionOptions.new(:message/gzip) } expect { blk.call }.to raise_error end end @@ -137,7 +137,7 @@ describe GRPC::Core::CompressionOptions do [:none, :any, 'gzip', Object.new, 1].each do |name| it "should fail for parameter ${name} of class #{name.class}" do options = GRPC::Core::CompressionOptions.new( - disabled_algorithms: [:gzip]) + disabled_algorithms: [:message/gzip]) blk = proc do options.algorithm_enabled?(name)