-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add new support for testing with environment variables #180
Conversation
`EnvironmentRestorer` is an RAII object that will, upon destruction, restore the previous state of environment variables that it modified. For example: ``` // ${VAR} has some initial state. { EnvironmentRestorer env; env.SetEnv("VAR", "value"); // ${VAR} now holds "value". } // The initial state of ${VAR} has been restored. ```
Codecov Report
@@ Coverage Diff @@
## master #180 +/- ##
==========================================
+ Coverage 96.23% 96.27% +0.03%
==========================================
Files 97 99 +2
Lines 4411 4429 +18
==========================================
+ Hits 4245 4264 +19
+ Misses 166 165 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r1.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @devjgm)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 6 of 6 files at r2.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @devbww)
…pis/google-cloud-cpp-common#180) `ScopedEnvironment` is an RAII object that will, upon destruction, restore the previous state of the environment variable it modified. For example: ``` // ${VAR} has some initial state. { ScopedEnvironment env("VAR", "value"); // ${VAR} now holds "value". } // The initial state of ${VAR} has been restored. ```
…pis/google-cloud-cpp-common#180) `ScopedEnvironment` is an RAII object that will, upon destruction, restore the previous state of the environment variable it modified. For example: ``` // ${VAR} has some initial state. { ScopedEnvironment env("VAR", "value"); // ${VAR} now holds "value". } // The initial state of ${VAR} has been restored. ```
…pis/google-cloud-cpp-common#180) `ScopedEnvironment` is an RAII object that will, upon destruction, restore the previous state of the environment variable it modified. For example: ``` // ${VAR} has some initial state. { ScopedEnvironment env("VAR", "value"); // ${VAR} now holds "value". } // The initial state of ${VAR} has been restored. ```
EnvironmentRestorer
is an RAII object that will, upon destruction,restore the previous state of environment variables that it modified.
For example:
[Note: The idea is for this to replace
EnvironmentVariableRestore
.]This change is