THRIFT-1789 fix json protocol read set begin
authorRoger Meier <roger@apache.org>
Sat, 19 Jan 2013 20:04:12 +0000 (21:04 +0100)
committerRoger Meier <roger@apache.org>
Sat, 19 Jan 2013 20:04:12 +0000 (21:04 +0100)
Patch: Kevin Radloff

lib/rb/lib/thrift/protocol/json_protocol.rb
lib/rb/spec/json_protocol_spec.rb

index 6f8d1d1..8694b7d 100644 (file)
@@ -717,6 +717,7 @@ module Thrift
 
     def read_set_begin
       read_json_array_start
+      [get_type_id_for_type_name(read_json_string), read_json_integer]
     end
 
     def read_set_end
index a294ac5..2f7f1e6 100644 (file)
@@ -435,8 +435,8 @@ describe 'JsonProtocol' do
     end
 
     it "should read set begin" do
-      @trans.write("[")
-      @prot.read_set_begin.should == nil
+      @trans.write("[\"rec\",2\"\"")
+      @prot.read_set_begin.should == [12, 2]
     end
 
     it "should read set end" do