Sha256: 58289bc43fa03a7940abc5636e54577a4c7ef4525b8102777f0aa15abcda0583
Contents?: true
Size: 786 Bytes
Versions: 30
Compression:
Stored size: 786 Bytes
Contents
require 'spec_helper' require 'protobuf/code_generator' describe 'protoc-gen-ruby' do let(:binpath) { ::File.expand_path('../../../bin/protoc-gen-ruby', __FILE__) } let(:request_bytes) { ::Google::Protobuf::Compiler::CodeGeneratorRequest.new(:file_to_generate => [ "test/foo.proto" ]) } let(:expected_file) { ::Google::Protobuf::Compiler::CodeGeneratorResponse::File.new(:name => 'test/foo.pb.rb') } let(:expected_response_bytes) { ::Google::Protobuf::Compiler::CodeGeneratorRequest.encode(:files => [ expected_file ]) } it 'reads the serialized request bytes and outputs serialized response bytes' do ::IO.popen(binpath, 'w+') do |pipe| pipe.write(request_bytes) pipe.read(expected_response_bytes.size).should eq expected_response_bytes end end end
Version data entries
30 entries across 30 versions & 2 rubygems