Add tests for environment detection