How do I get an ENV variable set for rspec?
If you just need to set environment variables, you can either set them from command-line: SOMETHING=123 SOMETHING_ELSE=”this is a test” rake spec Or you could define the following at the top of your Rakefile or spec_helper.rb: ENV[‘SOMETHING’]=123 ENV[‘SOMETHING_ELSE’]=”this is a test” If they don’t always apply, you could use a conditional: if something_needs_to_happen? ENV[‘SOMETHING’]=123 ENV[‘SOMETHING_ELSE’]=”this … Read more