Skip to content

Commit c344632

Browse files
committed
Exercise comparability test with LazyAttributeSet
LazyAttributeSet was added at rails#39612 for performance reason, it should not break comparability with AttributeSet, which was added at 9e25e0e.
1 parent f48c3ad commit c344632

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

activemodel/test/cases/attribute_set_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,12 @@ def builder.build_from_database(values = {}, additional_types = {})
274274
attributes = builder.build_from_database(foo: "1", bar: "2")
275275
attributes2 = builder.build_from_database(foo: "1", bar: "2")
276276
attributes3 = builder.build_from_database(foo: "2", bar: "2")
277+
attributes4 = attributes.deep_dup
277278

278279
assert_equal attributes, attributes2
279280
assert_not_equal attributes2, attributes3
281+
assert_equal attributes, attributes4
282+
assert_equal attributes4, attributes
280283
end
281284

282285
test "==(other) is safe to use with any instance" do

0 commit comments

Comments
 (0)