Skip to content

Commit 0dc25a9

Browse files
committed
Use assert_same in tests where applicable
1 parent df69e4a commit 0dc25a9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/psych/test_object_references.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def assert_reference_trip obj
3939
rescue Psych::DisallowedClass
4040
data = Psych.unsafe_load yml
4141
end
42-
assert_equal data.first.object_id, data.last.object_id
42+
assert_same data.first, data.last
4343
end
4444

4545
def test_float_references
@@ -49,7 +49,7 @@ def test_float_references
4949
- *name
5050
eoyml
5151
assert_equal data.first, data.last
52-
assert_equal data.first.object_id, data.last.object_id
52+
assert_same data.first, data.last
5353
end
5454

5555
def test_binary_references
@@ -60,7 +60,7 @@ def test_binary_references
6060
- *name
6161
eoyml
6262
assert_equal data.first, data.last
63-
assert_equal data.first.object_id, data.last.object_id
63+
assert_same data.first, data.last
6464
end
6565

6666
def test_regexp_references
@@ -70,7 +70,7 @@ def test_regexp_references
7070
- *name
7171
eoyml
7272
assert_equal data.first, data.last
73-
assert_equal data.first.object_id, data.last.object_id
73+
assert_same data.first, data.last
7474
end
7575
end
7676
end

test/psych/visitors/test_to_ruby.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def test_alias
319319

320320
list = seq.to_ruby
321321
assert_equal %w{ foo foo }, list
322-
assert_equal list[0].object_id, list[1].object_id
322+
assert_same list[0], list[1]
323323
end
324324

325325
def test_mapping_with_str_tag

0 commit comments

Comments
 (0)