How environment variables make your Ruby test suite flaky
14-Apr-2022 1444
Lots of apps use environment variables to manage environment-specific config. For example, an app might use environment variables to set 3rd party API keys. Or an app might use environment variables to toggle features on and off. Since environment variables are so commonly used, we’ll eventually want to test code that depends on these environment variables. And if we’re not careful, these tests can make our Ruby test suites flaky—tests that should be passing will randomly fail for unexpected reasons.Testing code that depends on environment variablesFor example, imagine we have a StringMultiplier class. New instances are initialized with a string, and there’s a .
How environment variables make your Ruby test suite flaky #ruby #rubydeveloper #rubyonrails #environment #variables #suite #flaky #environment #test https://rubyonrails.ba/link/how-environment-variables-make-your-ruby-test-suite-flaky