summaryrefslogtreecommitdiff
path: root/test/ruby/test_frozen.rb
AgeCommit message (Collapse)Author
2025-12-10Use actual class instead of singleton class in frozen error messageJeremy Evans
With the following code: ```ruby object = [] object.singleton_class object.freeze object.instance_variable_set(:@a, 42) ``` The previous error message was: ``` can't modify frozen #<Class:#<Array:0x00000631d1308f78>>: [] ``` With this change, the error message is: ``` can't modify frozen Array: [] ``` Since we show the inspect value of the affected object, I think including the singleton class instead of the actual class if it exists makes the error message harder to understand.
2022-06-16Added tests for setting ivars on frozen objsJemma Issroff
Notes: Merged: https://github.com/ruby/ruby/pull/6021