fake_process_manager 0.1.0+1

Dart native
Flutter Android iOS

Process Manager for faking processes in tests. Taken from Flutter Tools.

pub package Build Status codecov

A library for Dart developers.

Usage #

A simple usage example:

//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(<String>[cmd]);
    expect(result, equals(cmdResult));
    fakeProcessManager.verifyCalls();
  }, overrides: <Type, Generator>{
    ProcessManager: () => fakeProcessManager,
    Logger: () => VerboseLogger(StdoutLogger()),
  });
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
95
pub points
22%
popularity

Process Manager for faking processes in tests. Taken from Flutter Tools.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

mmcc007@gmail.com

License

MIT (LICENSE)

Dependencies

mockito, process, test, tool_base

More

Packages that depend on fake_process_manager