David Reiss | ea2cba8 | 2009-03-30 21:35:00 +0000 | [diff] [blame] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
Kevin Clark | 3eca078 | 2008-06-18 00:54:53 +0000 | [diff] [blame] | 20 | require 'rubygems' |
| 21 | require 'spec' |
| 22 | |
Kevin Clark | c819017 | 2008-07-28 22:16:34 +0000 | [diff] [blame] | 23 | $:.unshift File.join(File.dirname(__FILE__), *%w[.. ext]) |
| 24 | |
Bryan Duxbury | d1d1542 | 2009-04-04 00:58:03 +0000 | [diff] [blame] | 25 | # pretend we already loaded fastthread, otherwise the nonblocking_server_spec |
Kevin Clark | 3c59aff | 2008-06-18 01:17:37 +0000 | [diff] [blame] | 26 | # will get screwed up |
| 27 | # $" << 'fastthread.bundle' |
| 28 | |
Kevin Clark | 3eca078 | 2008-06-18 00:54:53 +0000 | [diff] [blame] | 29 | require File.dirname(__FILE__) + '/../lib/thrift' |
Kevin Clark | 0ff9e8c | 2008-06-18 01:05:03 +0000 | [diff] [blame] | 30 | |
| 31 | class Object |
| 32 | # tee is a useful method, so let's let our tests have it |
| 33 | def tee(&block) |
| 34 | block.call(self) |
| 35 | self |
| 36 | end |
| 37 | end |
Kevin Clark | c3783f4 | 2008-06-18 01:18:14 +0000 | [diff] [blame] | 38 | |
| 39 | Spec::Runner.configure do |configuration| |
| 40 | configuration.before(:each) do |
| 41 | Thrift.type_checking = true |
| 42 | end |
| 43 | end |
Bryan Duxbury | c016628 | 2009-02-02 00:48:17 +0000 | [diff] [blame] | 44 | |
Jake Farrell | 9c39f77 | 2011-08-30 19:12:10 +0000 | [diff] [blame^] | 45 | $:.unshift File.join(File.dirname(__FILE__), *%w[.. test debug_proto gen-rb]) |
Bryan Duxbury | 1deddc7 | 2009-05-29 20:11:27 +0000 | [diff] [blame] | 46 | require "srv" |
| 47 | require "debug_proto_test_constants" |
| 48 | |
| 49 | $:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb]) |
| 50 | require 'thrift_spec_types' |
| 51 | require 'nonblocking_service' |
Bryan Duxbury | d815c21 | 2009-03-19 18:57:43 +0000 | [diff] [blame] | 52 | |
| 53 | module Fixtures |
Bryan Duxbury | 9e4c041 | 2009-04-07 23:45:15 +0000 | [diff] [blame] | 54 | COMPACT_PROTOCOL_TEST_STRUCT = COMPACT_TEST.dup |
| 55 | COMPACT_PROTOCOL_TEST_STRUCT.a_binary = [0,1,2,3,4,5,6,7,8].pack('c*') |
Bryan Duxbury | 5b8b484 | 2009-04-01 20:10:15 +0000 | [diff] [blame] | 56 | COMPACT_PROTOCOL_TEST_STRUCT.set_byte_map = nil |
| 57 | COMPACT_PROTOCOL_TEST_STRUCT.map_byte_map = nil |
Roger Meier | 062de1b | 2011-03-04 13:10:58 +0000 | [diff] [blame] | 58 | end |