In our test and application code throughout this book, we've seen many examples of configurations set by environment variables. Here are some examples to refresh our memory:
In Chapter 3, Taking Control of State with Doubles and Hooks and Chapter 5, Simulating External Services, Redis was configured using
ENV['WQ_REDIS_URL']
In Chapter 5, Simulating External Services, network connectivity in specs was set with
ENV['ALLOW_NET_CONNECT']
In Chapter 6, Driving a Web Browser with Capybara and Chapter 7, Building an App from the Outside In with Behavior-Driven Development, the browser used to run e2e tests with Capybara was set with
ENV['BROWSER']
In Chapter 8, Tackling the Challenges of End-to-end Testing, the Sinatra environments and authentication secret were set using
ENV['SINATRA_ENV']
andENV['JWT_SECRET']
Using environment variables in this way gave us powerful options when running our app and its tests while maintaining a clean separation between code, tests...