aboutsummaryrefslogtreecommitdiffhomepage
path: root/ruby
diff options
context:
space:
mode:
authorGravatar @rubynerd <x@rubynerd.net>2017-10-12 18:23:01 +0100
committerGravatar @rubynerd <x@rubynerd.net>2017-10-12 18:23:01 +0100
commit1e58006b3cca28d11bbc92074c10b3295330b2b9 (patch)
treef4f9d44d5e4091ec56c0a45e73e17db7953e4c81 /ruby
parentf3e86fd26a685dd235e9a4849f62115e1348e91b (diff)
test for field reassignment
Diffstat (limited to 'ruby')
-rw-r--r--ruby/tests/repeated_field_test.rb6
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)