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-3.5.0 spec/support/packed_field.rb
protobuf-3.4.4 spec/support/packed_field.rb
protobuf-3.4.3 spec/support/packed_field.rb
protobuf-3.4.2 spec/support/packed_field.rb
protobuf-3.4.1 spec/support/packed_field.rb
protobuf-3.4.0 spec/support/packed_field.rb
protobuf-3.3.6 spec/support/packed_field.rb
protobuf-3.3.5 spec/support/packed_field.rb
protobuf-3.3.4 spec/support/packed_field.rb
protobuf-3.3.3 spec/support/packed_field.rb
protobuf-3.3.2 spec/support/packed_field.rb
protobuf-3.3.1 spec/support/packed_field.rb
protobuf-3.3.0 spec/support/packed_field.rb
protobuf-3.2.1 spec/support/packed_field.rb
protobuf-3.2.0 spec/support/packed_field.rb
protobuf-3.1.0 spec/support/packed_field.rb
protobuf-3.0.5 spec/support/packed_field.rb