Run the given action within the specified environment.
Before executing the action, withEnvironment backs up the current environment, clears out the environment, and then applies the supplied environment. After the action has completed the original environment is restored.
Note: The environment is global to a process, so tests that modify the environment can no longer be run in parallel.