Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mmcc007/fake_process_manager
A fake process manager for testing
https://github.com/mmcc007/fake_process_manager
Last synced: 25 days ago
JSON representation
A fake process manager for testing
- Host: GitHub
- URL: https://github.com/mmcc007/fake_process_manager
- Owner: mmcc007
- License: mit
- Created: 2019-09-07T18:43:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-01-11T20:57:57.000Z (almost 3 years ago)
- Last Synced: 2024-10-08T21:55:47.040Z (about 1 month ago)
- Language: Dart
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![pub package](https://img.shields.io/pub/v/fake_process_manager.svg)](https://pub.dartlang.org/packages/fake_process_manager)
[![Build Status](https://travis-ci.com/mmcc007/fake_process_manager.svg?branch=master)](https://travis-ci.com/mmcc007/fake_process_manager)
[![codecov](https://codecov.io/gh/mmcc007/fake_process_manager/branch/master/graph/badge.svg)](https://codecov.io/gh/mmcc007/fake_process_manager)A library for Dart developers.
## Usage
A simple usage example:
```dart
//import 'dart:io';import 'package:fake_process_manager/fake_process_manager.dart';
import 'package:process/process.dart';
import 'package:test/test.dart';
import 'package:tool_base/tool_base.dart';
import 'package:tool_base_test/tool_base_test.dart';import 'call_process.dart';
main() {
FakeProcessManager fakeProcessManager;setUp(() async {
fakeProcessManager = FakeProcessManager();
});testUsingContext('test', () {
final cmd = 'date';
final cmdResult = 'todays date';
fakeProcessManager.calls = [Call(cmd, ProcessResult(0, 0, cmdResult, ''))];
final result = runCmd([cmd]);
expect(result, equals(cmdResult));
fakeProcessManager.verifyCalls();
}, overrides: {
ProcessManager: () => fakeProcessManager,
Logger: () => VerboseLogger(StdoutLogger()),
});
}
```## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: http://example.com/issues/replaceme