Skip to content

Instantly share code, notes, and snippets.

@sephraim
Last active November 14, 2022 21:02
Show Gist options
  • Save sephraim/02fb87db0f823b760b32d3fe4897a238 to your computer and use it in GitHub Desktop.
Save sephraim/02fb87db0f823b760b32d3fe4897a238 to your computer and use it in GitHub Desktop.
[Stub ENV variables] Stub environment variables in RSpec tests
before(:example) do
stub_const('ENV', ENV.to_hash.merge('FOO' => 'bar', 'BAZ' => 'blah'))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment