-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move unsafe override to Test.Environment
- Loading branch information
Showing
5 changed files
with
44 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
distribution/lib/Standard/Test/0.0.0-dev/src/Environment.enso
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from Standard.Base import all | ||
|
||
polyglot java import org.enso.base.Environment_Utils | ||
|
||
## UNSTABLE | ||
ADVANCED | ||
|
||
Runs a given action with an environment variable modified to a given value. | ||
The environment variable is restored to its original value after the action. | ||
The environment variable override is only visible to the Enso | ||
`Environment.get` method, the environment as seen from a direct | ||
`System.getenv` Java call remains unchanged. | ||
unsafe_with_environment_override : Text -> Text -> Any -> Any | ||
unsafe_with_environment_override key value ~action = | ||
Environment_Utils.with_environment_variable_override key value (_->action) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters