thrift/lib/rb/spec/spec_helper.rb
Bryan Duxbury c016628a8a THRIFT-248. ruby: Factor BinaryProtocolAccelerated into separate protocol and struct components
This patch replaces the "binaryprotocolaccelerated" c extension with the "thrift_native" c extension. This new extension creates native implementations for the struct.rb #write and #read methods, Thrift::BinaryProtocol, and Thrift::MemoryBuffer, but keeps ruby-level interfaces, allowing all protocols to benefit from the struct code and the memory buffer. There is however an additional cost associated with going through this ruby layer, but the increased interoperability seems to be well worth it.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739895 13f79535-47bb-0310-9956-ffa450edef68
2009-02-02 00:48:17 +00:00

35 lines
831 B
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_native"