You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A huge bunch on specs should be modified to spec Ruby 2.5's behavior of raising a FrozenError when attempting to mutate a frozen object.
Instead duplicating the affected specs and referring to FrozenError directly, the helper frozen_error_class should be used (see this). As such, no direct mention of FrozenError should appear in the specs, only frozen_error_class.
I think in this case it would be fine to use the new terminology (raises a FrozenError if the array if frozen), what do you think @marcandre ?
I was thinking to raises a frozen error if the array if frozen but that's just misleading (as if the error was frozen). raises the appropriate error if the array if frozen doesn't say which so then we could just be generic and say raises an error if the array if frozen.
@andrykonchin That's smart :)
In general it's bad to have variable parts in the spec descriptions, because then they cannot be tagged reliably.
But since frozen_error_class only changes per Ruby version it would be fine.
Activity
Atul9 commentedon Dec 18, 2017
Yes, I have started working on this.
Atul9 commentedon Dec 18, 2017
In the spec description should we rename
RuntimeErrortofrozen_error_classORFrozenErrorRuntimeErrorif the array is frozento
frozen_error_classif array is frozen?OR
FrozenErrorif array if frozen?marcandre commentedon Dec 18, 2017
Mmm, good question. Maybe simply "raises the appropriate error if the ..."
eregon commentedon Dec 18, 2017
I think in this case it would be fine to use the new terminology (
raises a FrozenError if the array if frozen), what do you think @marcandre ?I was thinking to
raises a frozen error if the array if frozenbut that's just misleading (as if the error was frozen).raises the appropriate error if the array if frozendoesn't say which so then we could just be generic and sayraises an error if the array if frozen.eregon commentedon Dec 18, 2017
@Atul9 let's go with
FrozenErrorin the description for now. It's easy to globally search/replace after if needed :)Atul9 commentedon Dec 18, 2017
@eregon okay
andrykonchin commentedon Dec 18, 2017
@Atul9 I would choose interpolation
eregon commentedon Dec 18, 2017
@andrykonchin That's smart :)
In general it's bad to have variable parts in the spec descriptions, because then they cannot be tagged reliably.
But since
frozen_error_classonly changes per Ruby version it would be fine.