Test X by Controlling X
19-Sep-2022 844
So third is the question "how easy can I control X". The StackOverflow question that Shepmaster was answering was about environment variables (env vars). They are reasonably easy to control in most tests (in most languages and frameworks). But harder when you run tests in parallel because all running tests will re-use the same shared env-vars. If test 1 sets env var "URL" to "http://localhost:3000" and test 2 sets it to "http://example.com", there will be conflicts. Other difficulties are that a service you are testing, may need to be restarted to pick up a change to an environment variable, or that environment variables are enforced or overridden by your OS, CI, or hosting.
Test X by Controlling X #ruby #rubydeveloper #rubyonrails #Controlling #test https://rubyonrails.ba/link/test-x-by-controlling-x