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