rb: The shared binary protocol specs lacked a test for read_message_begin
authorBryan Duxbury <bryanduxbury@apache.org>
Tue, 31 Mar 2009 21:09:26 +0000 (21:09 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Tue, 31 Mar 2009 21:09:26 +0000 (21:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@760637 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/spec/binaryprotocol_spec_shared.rb

index ee34964..a8a6e90 100644 (file)
@@ -203,6 +203,11 @@ shared_examples_for 'a binary protocol' do
     lambda { @prot.write_string(nil) }.should raise_error
   end
   
+  it "should read message header correctly" do
+    @trans.write([protocol_class.const_get(:VERSION_1) | Thrift::MessageTypes::CALL, "testMessage".size, "testMessage", 17].pack("NNa11N"))
+    @prot.read_message_begin().should == ['testMessage', Thrift::MessageTypes::CALL, 17]
+  end
+  
   # message footer is a noop
   
   it "should read a field header" do