assert_select mutates the first string argument
obfuscoder opened this issue · 4 comments
obfuscoder commented
Using the new header # frozen_string_literal: true defines all strings as frozen. This is the recommended way in order to be ready for the transition to Ruby 3 where all strings will be immutable by default.
With that I got exceptions running code like this in my tests:
assert_select +'a[href=?]', some_path
It seems, assert_select mutates the first argument instead of dup'ing it first.
obfuscoder commented
There is no answer on this issue yet. Is this the right place or is this module maintained somewhere else now?
kaspth commented
Right place. Do submit a PR 😊
kaspth commented
It is. Thanks for checking!