aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/spec
diff options
context:
space:
mode:
authorGravatar Tim Emiola <temiola@google.com>2015-03-27 13:39:16 -0700
committerGravatar Tim Emiola <temiola@google.com>2015-04-10 11:23:42 -0700
commit37b09f4d839d47f11803af930e4cf4cb7af1e1e4 (patch)
treea7b9909242c56b1af273cf46ddc6f36e1c10fcea /src/ruby/spec
parent564719d28e9d37a949062c0ffc2361d3612635e7 (diff)
Adds the call operation codes
Diffstat (limited to 'src/ruby/spec')
-rw-r--r--src/ruby/spec/call_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ruby/spec/call_spec.rb b/src/ruby/spec/call_spec.rb
index 781c735e75..108051a1e5 100644
--- a/src/ruby/spec/call_spec.rb
+++ b/src/ruby/spec/call_spec.rb
@@ -66,6 +66,27 @@ describe GRPC::Core::RpcErrors do
end
end
+describe GRPC::Core::CallOps do
+ before(:each) do
+ @known_types = {
+ SEND_INITIAL_METADATA: 0,
+ SEND_MESSAGE: 1,
+ SEND_CLOSE_FROM_CLIENT: 2,
+ SEND_STATUS_FROM_SERVER: 3,
+ RECV_INITIAL_METADATA: 4,
+ RECV_MESSAGE: 5,
+ RECV_STATUS_ON_CLIENT: 6,
+ RECV_CLOSE_ON_SERVER: 7,
+ }
+ end
+
+ it 'should have symbols for all the known operation types' do
+ m = GRPC::Core::CallOps
+ syms_and_codes = m.constants.collect { |c| [c, m.const_get(c)] }
+ expect(Hash[syms_and_codes]).to eq(@known_types)
+ end
+end
+
describe GRPC::Core::Call do
let (:client_queue) { GRPC::Core::CompletionQueue.new }
let (:test_tag) { Object.new }