summaryrefslogtreecommitdiff
path: root/spec/ruby/core/set/shared/inspect.rb
AgeCommit message (Collapse)Author
2025-11-19Update to ruby/spec@6e62695Benoit Daloze
2025-06-25Simplify Set#inspect outputJeremy Evans
As Set is now a core collection class, it should have special inspect output. Ideally, inspect output should be suitable to eval, similar to array and hash (assuming the elements are also suitable to eval): set = Set[1, 2, 3] eval(set.inspect) == set # should be true The simplest way to do this is to use the Set[] syntax. This deliberately does not use any subclass name in the output, similar to array and hash. It is more important that users know they are dealing with a set than which subclass: Class.new(Set)[] # this does: Set[] # not: #<Class:0x00000c21c78699e0>[] This inspect change breaks the power_assert bundled gem tests, so add power_assert to TEST_BUNDLED_GEMS_ALLOW_FAILURES in the workflows. Implements [Feature #21389]
2025-05-09Update to ruby/spec@d8bacefAndrew Konchin
Notes: Merged: https://github.com/ruby/ruby/pull/13265