aboutsummaryrefslogtreecommitdiffhomepage
path: root/ruby/tests/well_known_types_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ruby/tests/well_known_types_test.rb')
-rw-r--r--ruby/tests/well_known_types_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/ruby/tests/well_known_types_test.rb b/ruby/tests/well_known_types_test.rb
index 3ce659a6..f35f7b13 100644
--- a/ruby/tests/well_known_types_test.rb
+++ b/ruby/tests/well_known_types_test.rb
@@ -126,11 +126,17 @@ class TestWellKnownTypes < Test::Unit::TestCase
end
def test_any
- any = Google::Protobuf::Any.new
ts = Google::Protobuf::Timestamp.new(seconds: 12345, nanos: 6789)
+
+ any = Google::Protobuf::Any.new
any.pack(ts)
assert any.is(Google::Protobuf::Timestamp)
assert_equal ts, any.unpack(Google::Protobuf::Timestamp)
+
+ any = Google::Protobuf::Any.pack(ts)
+
+ assert any.is(Google::Protobuf::Timestamp)
+ assert_equal ts, any.unpack(Google::Protobuf::Timestamp)
end
end