Add Cop RSpec/EnvMocking
What does this MR do and why?
Add Cop RSpec/EnvMocking
Bad:
allow(ENV).to receive(:[]).with('FOO').and_return('bar')
allow(ENV).to receive(:fetch).with('FOO').and_return('bar')
allow(ENV).to receive(:[]).with(key).and_return(value)
Good:
stub_env('FOO', 'bar')
stub_env(key, value)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Fixes #386536
Edited by Peter Leitzen