diff options
author | @rubynerd <x@rubynerd.net> | 2017-10-12 18:23:01 +0100 |
---|---|---|
committer | @rubynerd <x@rubynerd.net> | 2017-10-12 18:23:01 +0100 |
commit | 1e58006b3cca28d11bbc92074c10b3295330b2b9 (patch) | |
tree | f4f9d44d5e4091ec56c0a45e73e17db7953e4c81 /ruby | |
parent | f3e86fd26a685dd235e9a4849f62115e1348e91b (diff) |
test for field reassignment
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/tests/repeated_field_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ruby/tests/repeated_field_test.rb b/ruby/tests/repeated_field_test.rb index 25727b7b..b64c3991 100644 --- a/ruby/tests/repeated_field_test.rb +++ b/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) |