Kevin Clark | 3eca078 | 2008-06-18 00:54:53 +0000 | [diff] [blame] | 1 | require 'rubygems' |
Kevin Clark | 356f861 | 2008-06-18 01:08:05 +0000 | [diff] [blame] | 2 | # require at least 1.1.4 to fix a bug with describing Modules |
| 3 | gem 'rspec', '>= 1.1.4' |
Kevin Clark | 3eca078 | 2008-06-18 00:54:53 +0000 | [diff] [blame] | 4 | require 'spec' |
| 5 | |
Kevin Clark | c819017 | 2008-07-28 22:16:34 +0000 | [diff] [blame] | 6 | $:.unshift File.join(File.dirname(__FILE__), *%w[.. ext]) |
| 7 | |
Kevin Clark | 3c59aff | 2008-06-18 01:17:37 +0000 | [diff] [blame] | 8 | # pretend we already loaded fastthread, otherwise the nonblockingserver_spec |
| 9 | # will get screwed up |
| 10 | # $" << 'fastthread.bundle' |
| 11 | |
Kevin Clark | d47cd66 | 2008-06-18 01:05:17 +0000 | [diff] [blame] | 12 | # turn on deprecation so we can test it |
| 13 | module Thrift |
David Reiss | 72754e1 | 2008-07-25 21:06:03 +0000 | [diff] [blame] | 14 | # squelch any warnings if we happen to get required twice |
| 15 | remove_const(:DEPRECATION) if const_defined? :DEPRECATION |
Kevin Clark | d47cd66 | 2008-06-18 01:05:17 +0000 | [diff] [blame] | 16 | DEPRECATION = true |
| 17 | end |
| 18 | |
Kevin Clark | 3eca078 | 2008-06-18 00:54:53 +0000 | [diff] [blame] | 19 | require File.dirname(__FILE__) + '/../lib/thrift' |
Kevin Clark | 0ff9e8c | 2008-06-18 01:05:03 +0000 | [diff] [blame] | 20 | |
| 21 | class Object |
| 22 | # tee is a useful method, so let's let our tests have it |
| 23 | def tee(&block) |
| 24 | block.call(self) |
| 25 | self |
| 26 | end |
| 27 | end |
Kevin Clark | c3783f4 | 2008-06-18 01:18:14 +0000 | [diff] [blame] | 28 | |
| 29 | Spec::Runner.configure do |configuration| |
| 30 | configuration.before(:each) do |
| 31 | Thrift.type_checking = true |
| 32 | end |
| 33 | end |
Bryan Duxbury | c016628 | 2009-02-02 00:48:17 +0000 | [diff] [blame] | 34 | |
Bryan Duxbury | d815c21 | 2009-03-19 18:57:43 +0000 | [diff] [blame] | 35 | require "thrift/protocol/compact_protocol" |
| 36 | require "thrift_native" |
| 37 | |
| 38 | require File.dirname(__FILE__) + "/../debug_proto_test/gen-rb/Srv" |
| 39 | |
| 40 | module Fixtures |
| 41 | COMPACT_PROTOCOL_TEST_STRUCT = CompactProtoTestStruct.new(:a_binary => [0,1,2,3,4,5,6,7,8].pack('c*')) |
| 42 | end |