tree: 9ce485b208489b97febf0166da2dfe2f8f8c965a [path history] [tgz]
  1. lib/
  2. .gitignore
  3. analysis_options.yaml
  4. CHANGELOG.md
  5. LICENSE
  6. pubspec.yaml
  7. README.md
pkgs/file_testing/README.md

pub package package publisher

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/memory.dart';
import 'package:file_testing/file_testing.dart';
import 'package:test/test.dart';

void main() {
  MemoryFileSystem fs;

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

  test('some test', () {
    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);
  });
}