From 0dc25a9d6ae28a24bb8a8168f4ac2c27e413dc7c Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Mon, 18 Dec 2023 04:01:01 -0500 Subject: [PATCH] Use `assert_same` in tests where applicable --- test/psych/test_object_references.rb | 8 ++++---- test/psych/visitors/test_to_ruby.rb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/psych/test_object_references.rb b/test/psych/test_object_references.rb index 269d7224..86bb9034 100644 --- a/test/psych/test_object_references.rb +++ b/test/psych/test_object_references.rb @@ -39,7 +39,7 @@ def assert_reference_trip obj rescue Psych::DisallowedClass data = Psych.unsafe_load yml end - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end def test_float_references @@ -49,7 +49,7 @@ def test_float_references - *name eoyml assert_equal data.first, data.last - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end def test_binary_references @@ -60,7 +60,7 @@ def test_binary_references - *name eoyml assert_equal data.first, data.last - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end def test_regexp_references @@ -70,7 +70,7 @@ def test_regexp_references - *name eoyml assert_equal data.first, data.last - assert_equal data.first.object_id, data.last.object_id + assert_same data.first, data.last end end end diff --git a/test/psych/visitors/test_to_ruby.rb b/test/psych/visitors/test_to_ruby.rb index 3d4608b9..89c36766 100644 --- a/test/psych/visitors/test_to_ruby.rb +++ b/test/psych/visitors/test_to_ruby.rb @@ -319,7 +319,7 @@ def test_alias list = seq.to_ruby assert_equal %w{ foo foo }, list - assert_equal list[0].object_id, list[1].object_id + assert_same list[0], list[1] end def test_mapping_with_str_tag