(maint) Fix two spec tests to be robust when running in a path with parens

Both of these spec tests were including the working directory (via
the 'envdir' variable) in the regex to match against, but did so without
properly escaping the directory path. This meant that if the working
directory path included parentheses they were interpreted as regex
symbols rather than bare parentheses.

This could be fixed by wrapping the envdir in Regexp.escape, but
the path isn't really important to check for in this warning message,
so I just removed it from the regex.
Merge remote-tracking branch 'origin/stable'