Propagate `includeParentEnvironment` (#41)
diff --git a/CHANGELOG.md b/CHANGELOG.md index 038bb4b..f19e210 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md
@@ -1,5 +1,10 @@ # Change Log for `process_runner` +## 4.2.3 + +- Propagate `includeParentEnvironment` to process manager (fixes + [#36](https://github.com/google/process_runner/issues/36)) + ## 4.2.2 - Refactoring the main `run` method in `ProcessRunner` into smaller, more
diff --git a/pubspec.yaml b/pubspec.yaml index 02f0f49..b965008 100644 --- a/pubspec.yaml +++ b/pubspec.yaml
@@ -4,7 +4,7 @@ name: process_runner description: A process invocation abstraction for Dart that manages a multi-process queue. -version: 4.2.2 +version: 4.2.3 repository: https://github.com/google/process_runner issue_tracker: https://github.com/google/process_runner/issues documentation: https://github.com/google/process_runner/blob/master/process_runner/README.md
diff --git a/test/src/process_runner_test.dart b/test/src/process_runner_test.dart index ef7c50f..e74c88a 100644 --- a/test/src/process_runner_test.dart +++ b/test/src/process_runner_test.dart
@@ -119,6 +119,28 @@ fakeProcessManager.verifyCalls(calls.keys); }); + test('runProcess passes includeParentEnvironment to manager', () async { + processRunner = ProcessRunner( + processManager: fakeProcessManager, + defaultWorkingDirectory: Directory(testPath), + includeParentEnvironment: false, + ); + final calls = <FakeInvocationRecord, List<ProcessResult>>{ + FakeInvocationRecord( + <String>['command', 'arg1', 'arg2'], + workingDirectory: testPath, + includeParentEnvironment: false, + ): <ProcessResult>[ + ProcessResult(0, 0, 'output1', ''), + ], + }; + fakeProcessManager.fakeResults = calls; + await processRunner.runProcess( + <String>['command', 'arg1', 'arg2'], + ); + fakeProcessManager.verifyCalls(calls.keys); + }); + test('runProcess throws when process manager throws', () async { fakeProcessManager.commandsThrow = true; final calls = <FakeInvocationRecord, List<ProcessResult>>{