Mock your ENVs.
Add the following code on your Gemfile
and run bundle install
:
gem 'env_mock'
ENV['DATABASE_USERNAME'] = 'root'
ENV['DATABASE_USERNAME']
=> 'root'
ENV['TAX_CENTS']
=> nil
ENV['UDP']
=> nil
EnvMock.mock(DATABASE_USERNAME: 'wbotelhos', TAX_CENTS: 700, 'udp' => true) do
ENV['DATABASE_USERNAME'] # .to_s is called for all keys
=> 'wbotelhos'
ENV['TAX_CENTS']
=> '700' # `.to_s` is called for all values
ENV['UDP'] # .upcase is called for all keys
=> 'true'
end
ENV['DATABASE_USERNAME']
=> 'root'
ENV['TAX_CENTS']
=> nil
ENV['UDP']
=> nil