blob: 8664b66459559d50a7e9de6deb95046a499e9846 [file] [log] [blame]
Jake Farrell5d6bd5a2012-10-01 18:42:23 +00001# encoding: UTF-8
David Reissea2cba82009-03-30 21:35:00 +00002#
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 Clark3eca0782008-06-18 00:54:53 +000021require 'rubygems'
Jake Farrella87810f2012-09-28 01:59:04 +000022require 'rspec'
Kevin Clark3eca0782008-06-18 00:54:53 +000023
Kevin Clarkc8190172008-07-28 22:16:34 +000024$:.unshift File.join(File.dirname(__FILE__), *%w[.. ext])
25
Bryan Duxburyd1d15422009-04-04 00:58:03 +000026# pretend we already loaded fastthread, otherwise the nonblocking_server_spec
Kevin Clark3c59aff2008-06-18 01:17:37 +000027# will get screwed up
28# $" << 'fastthread.bundle'
29
Jake Farrella87810f2012-09-28 01:59:04 +000030require 'thrift'
Kevin Clark0ff9e8c2008-06-18 01:05:03 +000031
Jake Farrell5d6bd5a2012-10-01 18:42:23 +000032unless 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 Clark0ff9e8c2008-06-18 01:05:03 +000039 end
40end
Kevin Clarkc3783f42008-06-18 01:18:14 +000041
Jake Farrella87810f2012-09-28 01:59:04 +000042RSpec.configure do |configuration|
Kevin Clarkc3783f42008-06-18 01:18:14 +000043 configuration.before(:each) do
44 Thrift.type_checking = true
45 end
46end
Bryan Duxburyc0166282009-02-02 00:48:17 +000047
Jake Farrell9c39f772011-08-30 19:12:10 +000048$:.unshift File.join(File.dirname(__FILE__), *%w[.. test debug_proto gen-rb])
Jake Farrella87810f2012-09-28 01:59:04 +000049require 'srv'
50require 'debug_proto_test_constants'
Bryan Duxbury1deddc72009-05-29 20:11:27 +000051
52$:.unshift File.join(File.dirname(__FILE__), *%w[gen-rb])
53require 'thrift_spec_types'
54require 'nonblocking_service'
Bryan Duxburyd815c212009-03-19 18:57:43 +000055
56module Fixtures
Bryan Duxbury9e4c0412009-04-07 23:45:15 +000057 COMPACT_PROTOCOL_TEST_STRUCT = COMPACT_TEST.dup
58 COMPACT_PROTOCOL_TEST_STRUCT.a_binary = [0,1,2,3,4,5,6,7,8].pack('c*')
Bryan Duxbury5b8b4842009-04-01 20:10:15 +000059 COMPACT_PROTOCOL_TEST_STRUCT.set_byte_map = nil
60 COMPACT_PROTOCOL_TEST_STRUCT.map_byte_map = nil
Roger Meier062de1b2011-03-04 13:10:58 +000061end