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