Sha256: b3e99cf6dd600b268d305533e9e657488eecdb071e0afea45d68c9b45eecc96b
Contents?: true
Size: 799 Bytes
Versions: 2
Compression:
Stored size: 799 Bytes
Contents
require 'spec_helper' require 'protobuf/code_generator' RSpec.describe 'protoc-gen-ruby' do let(:binpath) { ::File.expand_path('../../../bin/protoc-gen-ruby', __FILE__) } let(:package) { 'test' } let(:request_bytes) do ::Google::Protobuf::Compiler::CodeGeneratorRequest.encode( :proto_file => [{ :package => package }] ) end it 'reads the serialized request bytes and outputs serialized response bytes' do ::IO.popen(binpath, 'w+') do |pipe| pipe.write(request_bytes) pipe.close_write # needed so we can implicitly read until EOF response_bytes = pipe.read response = ::Google::Protobuf::Compiler::CodeGeneratorResponse.decode(response_bytes) expect(response.file.first.content).to include("module #{package.titleize}") end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
protobuffy-4.0.1 | spec/bin/protoc-gen-ruby_spec.rb |
protobuffy-4.0.0 | spec/bin/protoc-gen-ruby_spec.rb |