Sha256: 66914e47c3a22a57a42fabdc633076c481195172677d91e1c8a6b6c2b95f703b

Contents?: true

Size: 901 Bytes

Versions: 27

Compression:

Stored size: 901 Bytes

Contents

require 'spec_helper'

require 'protobuf/generators/file_generator'

describe ::Protobuf::Generators::FileGenerator do

  let(:base_descriptor_fields) { { :name => 'test/foo.proto' } }
  let(:descriptor_fields) { base_descriptor_fields }
  let(:file_descriptor) { ::Google::Protobuf::FileDescriptorProto.new(descriptor_fields) }

  subject { described_class.new(file_descriptor) }
  its(:file_name) { should eq 'test/foo.pb.rb' }

  describe '#print_import_requires' do
    let(:descriptor_fields) do
      base_descriptor_fields.merge!({ :dependency => [ 'test/bar.proto',
                                                       'test/baz.proto' ] })
    end

    it 'prints a ruby require for each dependency' do
      subject.should_receive(:print_require).with('test/bar.pb')
      subject.should_receive(:print_require).with('test/baz.pb')
      subject.print_import_requires
    end

  end

end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
protobuffy-3.6.0 spec/lib/protobuf/generators/file_generator_spec.rb
protobuffy-3.5.1 spec/lib/protobuf/generators/file_generator_spec.rb
protobuffy-3.4.0 spec/lib/protobuf/generators/file_generator_spec.rb
protobuffy-3.3.0 spec/lib/protobuf/generators/file_generator_spec.rb
protobuffy-3.2.0 spec/lib/protobuf/generators/file_generator_spec.rb
protobuffy-3.1.0 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-3.0.4 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-2.8.13 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-3.0.3 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-3.0.2 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-3.0.1 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-3.0.0 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-3.0.0.rc2 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-3.0.0.rc1 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-2.8.12 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-2.8.11 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-2.8.10 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-2.8.9 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-2.8.8 spec/lib/protobuf/generators/file_generator_spec.rb
protobuf-2.8.7 spec/lib/protobuf/generators/file_generator_spec.rb