test for field reassignment

pull/2519/head
@rubynerd 7 years ago
parent f3e86fd26a
commit 1e58006b3c
  1. 6
      ruby/tests/repeated_field_test.rb

@ -126,6 +126,12 @@ class RepeatedFieldTest < Test::Unit::TestCase
assert_equal false, m.repeated_string.empty?
end
def test_reassign
m = TestMessage.new
m.repeated_msg = Google::Protobuf::RepeatedField.new(:message, TestMessage2, [TestMessage2.new(:foo => 1)])
assert_equal m.repeated_msg.first, TestMessage2.new(:foo => 1)
end
def test_array_accessor
m = TestMessage.new
reference_arr = %w(foo bar baz)

Loading…
Cancel
Save