tree: 0ac28e186cc6452423ce1ff640f3e47f1229f58a [path history] [tgz]
  1. lib/
  2. CHANGELOG.md
  3. LICENSE
  4. pubspec.yaml
  5. README.md
packages/file_testing/README.md

file_testing

Testing utilities intended to work with package:file

Features

This package provides a series of matchers to be used in tests that work with file system types.

Usage

import 'package:file/file.dart';
import 'package:file_testing/file_testing.dart';
import 'package:test/test.dart';

test('some test', () {
  MemoryFileSystem fs;

  setUp(() {
    fs = new MemoryFileSystem();
    fs.file('/foo').createSync();
  });

  expectFileSystemException(ErrorCodes.ENOENT, () {
    fs.directory('').resolveSymbolicLinksSync();
  });
  expect(fs.file('/path/to/file'), isFile);
  expect(fs.file('/path/to/directory'), isDirectory);
  expect(fs.file('/foo'), exists);
});