aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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)