From 9e4c04125e4e4e113ceba64116acfccd7a8f7f04 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Tue, 7 Apr 2009 23:45:15 +0000 Subject: [PATCH] THRIFT-444. rb: THRIFT-356 broke compact protocol spec This patch cleans up the spec, removing some unncessary code. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@763043 13f79535-47bb-0310-9956-ffa450edef68 --- lib/rb/spec/compact_protocol_spec.rb | 15 ++------------- lib/rb/spec/spec_helper.rb | 4 +++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/rb/spec/compact_protocol_spec.rb b/lib/rb/spec/compact_protocol_spec.rb index 78b1a2a2..b9a79810 100644 --- a/lib/rb/spec/compact_protocol_spec.rb +++ b/lib/rb/spec/compact_protocol_spec.rb @@ -76,21 +76,10 @@ describe Thrift::CompactProtocol do struct = CompactProtoTestStruct.new # sets and maps don't hash well... not sure what to do here. - struct.set_byte_map = nil - struct.map_byte_map = nil struct.write(proto) - - # puts trans.inspect - - struct2 = CompactProtoTestStruct.new - struct2.instance_variables.each do |ivar| - struct2.instance_variable_set(ivar, nil) - end - - struct2.should_not == struct - struct2.read(proto) - + struct2 = CompactProtoTestStruct.new + struct2.read(proto) struct2.should == struct end diff --git a/lib/rb/spec/spec_helper.rb b/lib/rb/spec/spec_helper.rb index 41bf631e..3c20bf99 100644 --- a/lib/rb/spec/spec_helper.rb +++ b/lib/rb/spec/spec_helper.rb @@ -45,9 +45,11 @@ Spec::Runner.configure do |configuration| end require File.dirname(__FILE__) + "/../debug_proto_test/gen-rb/Srv" +require File.dirname(__FILE__) + "/../debug_proto_test/gen-rb/debug_proto_test_constants" module Fixtures - COMPACT_PROTOCOL_TEST_STRUCT = CompactProtoTestStruct.new(:a_binary => [0,1,2,3,4,5,6,7,8].pack('c*')) + COMPACT_PROTOCOL_TEST_STRUCT = COMPACT_TEST.dup + COMPACT_PROTOCOL_TEST_STRUCT.a_binary = [0,1,2,3,4,5,6,7,8].pack('c*') COMPACT_PROTOCOL_TEST_STRUCT.set_byte_map = nil COMPACT_PROTOCOL_TEST_STRUCT.map_byte_map = nil end \ No newline at end of file -- 2.17.1