diff options
author | Yilun Chong <yilunchong@google.com> | 2017-06-26 17:46:34 -0700 |
---|---|---|
committer | Yilun Chong <yilunchong@google.com> | 2017-06-26 17:46:34 -0700 |
commit | 2ad74e1606728564cc777aa4917d7e2299317eda (patch) | |
tree | 9fcffc5af50f168b3fce9e769a1d98dceda6d932 /conformance/conformance_ruby.rb | |
parent | 4e67590e1b42897b674d6bfdae3b7c8f1d4cf5e5 (diff) | |
download | protobuf-2ad74e1606728564cc777aa4917d7e2299317eda.tar.gz protobuf-2ad74e1606728564cc777aa4917d7e2299317eda.tar.bz2 protobuf-2ad74e1606728564cc777aa4917d7e2299317eda.zip |
add support for proto2
Diffstat (limited to 'conformance/conformance_ruby.rb')
-rwxr-xr-x | conformance/conformance_ruby.rb | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/conformance/conformance_ruby.rb b/conformance/conformance_ruby.rb index b7b7cf1c..a1170e4c 100755 --- a/conformance/conformance_ruby.rb +++ b/conformance/conformance_ruby.rb @@ -43,12 +43,19 @@ def do_test(request) begin case request.payload when :protobuf_payload - begin - test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( - request.protobuf_payload) - rescue Google::Protobuf::ParseError => err - response.parse_error = err.message.encode('utf-8') - return response + if request.message_type.eql?('proto3') + begin + test_message = ProtobufTestMessages::Proto3::TestAllTypes.decode( + request.protobuf_payload) + rescue Google::Protobuf::ParseError => err + response.parse_error = err.message.encode('utf-8') + return response + end + elsif request.message_type.eql?('proto2') + response.skipped = "Ruby doesn't support proto2" + return respons + else + fail "Protobuf request doesn't have specific type" end when :json_payload |