Sha256: bf5924b0d4c42a62a685e9d285370d185d7c5fcaa51a0fd8dd121b0359f6a0a1

Contents?: true

Size: 790 Bytes

Versions: 2

Compression:

Stored size: 790 Bytes

Contents

require "spec_helper"
require "tmpdir"

describe "WireCompiler" do
  # Compile the contents of the generator_tests proto dir, and then assert
  # everything is where it should be.
  it "computes fully-qualified class names correctly" do
    Dir.mktmpdir do |dir|
      # The following is to compile protos with wire, since its done as a
      # separate process:
      compile_wire_protobuf(source: "#{File.dirname(__FILE__)}/protos/generator_test/", destination: dir)
      generated_classes = ghetto_parse_java_package(dir)

      with_descriptor("generator_test") do |descriptor|
        children = descriptor.all_descendants

        children.each do |child|
          expect(child.fully_qualified_wire_name).to eq(generated_classes[child.name])
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
protobuf_descriptor-1.0.0 spec/wire_generator_spec.rb
protobuf_descriptor-0.1.0 spec/wire_generator_spec.rb