mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-08 11:13:55 +00:00
d815c218c8
This patch includes both a pure Ruby and C-extension port of the Compact Protocol described in THRIFT-110. It also fixes a bug in struct.c that was interfering with native protocol method calls, and adds some utility classes to the Java library for serializing/deserializing to a file for the purpose of testing protocols cross-language. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756133 13f79535-47bb-0310-9956-ffa450edef68
42 lines
1.0 KiB
Ruby
42 lines
1.0 KiB
Ruby
require 'rubygems'
|
|
# require at least 1.1.4 to fix a bug with describing Modules
|
|
gem 'rspec', '>= 1.1.4'
|
|
require 'spec'
|
|
|
|
$:.unshift File.join(File.dirname(__FILE__), *%w[.. ext])
|
|
|
|
# pretend we already loaded fastthread, otherwise the nonblockingserver_spec
|
|
# will get screwed up
|
|
# $" << 'fastthread.bundle'
|
|
|
|
# turn on deprecation so we can test it
|
|
module Thrift
|
|
# squelch any warnings if we happen to get required twice
|
|
remove_const(:DEPRECATION) if const_defined? :DEPRECATION
|
|
DEPRECATION = true
|
|
end
|
|
|
|
require File.dirname(__FILE__) + '/../lib/thrift'
|
|
|
|
class Object
|
|
# tee is a useful method, so let's let our tests have it
|
|
def tee(&block)
|
|
block.call(self)
|
|
self
|
|
end
|
|
end
|
|
|
|
Spec::Runner.configure do |configuration|
|
|
configuration.before(:each) do
|
|
Thrift.type_checking = true
|
|
end
|
|
end
|
|
|
|
require "thrift/protocol/compact_protocol"
|
|
require "thrift_native"
|
|
|
|
require File.dirname(__FILE__) + "/../debug_proto_test/gen-rb/Srv"
|
|
|
|
module Fixtures
|
|
COMPACT_PROTOCOL_TEST_STRUCT = CompactProtoTestStruct.new(:a_binary => [0,1,2,3,4,5,6,7,8].pack('c*'))
|
|
end |