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