Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/rb/lib/thrift/protocol/base_protocol.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def initialize(trans)
end

def native?
puts "wrong method is being called!"
false
end

Expand Down
12 changes: 12 additions & 0 deletions lib/rb/spec/base_protocol_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading