Allow stub_env to remove environment variable value
This commit is contained in:
parent
9506c7b323
commit
e9cae1a2f2
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user