diff --git a/lib/rb/lib/thrift/protocol/base_protocol.rb b/lib/rb/lib/thrift/protocol/base_protocol.rb index 2a13b692ec8..b91defd8efa 100644 --- a/lib/rb/lib/thrift/protocol/base_protocol.rb +++ b/lib/rb/lib/thrift/protocol/base_protocol.rb @@ -49,7 +49,6 @@ def initialize(trans) end def native? - puts "wrong method is being called!" false end diff --git a/lib/rb/spec/base_protocol_spec.rb b/lib/rb/spec/base_protocol_spec.rb index aa4ace0d852..29eb4295610 100644 --- a/lib/rb/spec/base_protocol_spec.rb +++ b/lib/rb/spec/base_protocol_spec.rb @@ -38,6 +38,18 @@ expect(@prot.trans).to eql(@trans) end + it "should report native capability without writing to stdout or stderr" do + binary = Thrift::BinaryProtocol.new(Thrift::MemoryBufferTransport.new) + compact = Thrift::CompactProtocol.new(Thrift::MemoryBufferTransport.new) + expected_compact_native = defined?(Thrift::BinaryProtocolAccelerated) ? true : false + + expect do + expect(@prot.native?).to be(false) + expect(binary.native?).to be(false) + expect(compact.native?).to eq(expected_compact_native) + end.to output("").to_stdout.and output("").to_stderr + end + it 'should write out a field nicely (deprecated write_field signature)' do expect(@prot).to receive(:write_field_begin).with('field', 'type', 'fid').ordered expect(@prot).to receive(:write_type).with({:name => 'field', :type => 'type'}, 'value').ordered