Sha256: 6b70ff156c36a620583fd64d489b5d453ab9d9c3d2d2339beff0c99a5cf30ccb

Contents?: true

Size: 714 Bytes

Versions: 13

Compression:

Stored size: 714 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) }

    it { should be_packed }

  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
protobuffy-3.6.0 spec/support/packed_field.rb
protobuffy-3.5.1 spec/support/packed_field.rb
protobuffy-3.4.0 spec/support/packed_field.rb
protobuffy-3.3.0 spec/support/packed_field.rb
protobuffy-3.2.0 spec/support/packed_field.rb
protobuffy-3.1.0 spec/support/packed_field.rb
protobuf-3.0.4 spec/support/packed_field.rb
protobuf-3.0.3 spec/support/packed_field.rb
protobuf-3.0.2 spec/support/packed_field.rb
protobuf-3.0.1 spec/support/packed_field.rb
protobuf-3.0.0 spec/support/packed_field.rb
protobuf-3.0.0.rc2 spec/support/packed_field.rb
protobuf-3.0.0.rc1 spec/support/packed_field.rb