Allow stub_env to remove environment variable value

This commit is contained in:
Chris Roberts 2020-11-06 08:01:16 -08:00
parent 9506c7b323
commit e9cae1a2f2

View File

@ -103,9 +103,10 @@ shared_context "unit" do
allow(ENV).to receive(:[]).and_call_original
hash.each do |key, value|
v = value.nil? ? nil : value.to_s
allow(ENV).to receive(:[])
.with(key.to_s)
.and_return(value.to_s)
.and_return(v)
end
end