Skip to content

Commit

Permalink
Use assert_same in tests where applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
amomchilov committed Dec 18, 2023
1 parent df69e4a commit 0dc25a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/psych/test_object_references.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion test/psych/visitors/test_to_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0dc25a9

Please sign in to comment.