Sha256: c68de04b10944b3bdac5fab6a15530bf5ba991a2fe5237b658e20066d8a30cce

Contents?: true

Size: 731 Bytes

Versions: 37

Compression:

Stored size: 731 Bytes

Contents

if defined?(RSpec)
  shared_examples_for :packable_field do |field_klass|

    before(:all) do
      unless defined?(PackableFieldTest)
        class PackableFieldTest < ::Protobuf::Message; end
      end

      field_name = "#{field_klass.name.split('::').last.underscore}_packed_field".to_sym
      tag_num = PackableFieldTest.fields.size + 1
      PackableFieldTest.repeated(field_klass, field_name, tag_num, :packed => true)
    end

    let(:field_name) { "#{field_klass.name.split('::').last.underscore}_packed_field".to_sym }
    let(:message_instance) { PackableFieldTest.new(field_name => [100, 200, 300]) }

    subject { PackableFieldTest.get_field(field_name) }

    specify { expect(subject).to be_packed }

  end
end

Version data entries

37 entries across 37 versions & 3 rubygems

Version Path
protobuf-core-3.5.0 spec/support/packed_field.rb
protobuf-3.6.12 spec/support/packed_field.rb
protobuf-3.6.11 spec/support/packed_field.rb
protobuf-3.6.10 spec/support/packed_field.rb
protobuf-3.7.0.pre2 spec/support/packed_field.rb
protobuf-3.6.9 spec/support/packed_field.rb
protobuf-3.7.0.pre1 spec/support/packed_field.rb
protobuf-3.7.0.pre0 spec/support/packed_field.rb
protobuf-3.6.7 spec/support/packed_field.rb
protobuf-3.6.6 spec/support/packed_field.rb
protobuf-3.6.2 spec/support/packed_field.rb
protobuf-3.6.1 spec/support/packed_field.rb
protobuf-3.6.0 spec/support/packed_field.rb
protobuf-3.5.5 spec/support/packed_field.rb
protobuf-3.5.4 spec/support/packed_field.rb
protobuf-3.5.3 spec/support/packed_field.rb
protobuf-3.5.2 spec/support/packed_field.rb
protobuf-3.5.1 spec/support/packed_field.rb
prepor-protobuf-3.5.1 spec/support/packed_field.rb
prepor-protobuf-3.5.0 spec/support/packed_field.rb