2009-03-30 21:35:00 +00:00
|
|
|
#
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
# or more contributor license agreements. See the NOTICE file
|
|
|
|
# distributed with this work for additional information
|
|
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
|
|
# to you under the Apache License, Version 2.0 (the
|
|
|
|
# "License"); you may not use this file except in compliance
|
|
|
|
# with the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing,
|
|
|
|
# software distributed under the License is distributed on an
|
|
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
|
|
# KIND, either express or implied. See the License for the
|
|
|
|
# specific language governing permissions and limitations
|
|
|
|
# under the License.
|
|
|
|
#
|
|
|
|
|
2012-09-28 01:59:04 +00:00
|
|
|
require 'spec_helper'
|
2011-11-10 00:53:17 +00:00
|
|
|
require File.expand_path("#{File.dirname(__FILE__)}/binary_protocol_spec_shared")
|
2008-07-25 21:06:03 +00:00
|
|
|
|
2010-02-16 21:19:01 +00:00
|
|
|
if defined? Thrift::BinaryProtocolAccelerated
|
2008-07-25 21:06:03 +00:00
|
|
|
|
2012-09-28 01:59:04 +00:00
|
|
|
describe 'BinaryProtocolAccelerated' do
|
|
|
|
# since BinaryProtocolAccelerated should be directly equivalent to
|
|
|
|
# BinaryProtocol, we don't need any custom specs!
|
|
|
|
it_should_behave_like 'a binary protocol'
|
2008-07-25 21:06:03 +00:00
|
|
|
|
2012-09-28 01:59:04 +00:00
|
|
|
def protocol_class
|
|
|
|
Thrift::BinaryProtocolAccelerated
|
2008-07-25 21:06:03 +00:00
|
|
|
end
|
|
|
|
|
2012-09-28 01:59:04 +00:00
|
|
|
describe Thrift::BinaryProtocolAcceleratedFactory do
|
2010-02-16 21:19:01 +00:00
|
|
|
it "should create a BinaryProtocolAccelerated" do
|
2012-09-28 01:59:04 +00:00
|
|
|
Thrift::BinaryProtocolAcceleratedFactory.new.get_protocol(mock("MockTransport")).should be_instance_of(Thrift::BinaryProtocolAccelerated)
|
2010-02-16 21:19:01 +00:00
|
|
|
end
|
2008-07-25 21:06:03 +00:00
|
|
|
end
|
|
|
|
end
|
2010-02-16 21:19:01 +00:00
|
|
|
else
|
|
|
|
puts "skipping BinaryProtocolAccelerated spec because it is not defined."
|
|
|
|
end
|