Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Latest commit

 

History

History

file_testing

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Note

The source-of-truth for this package has moved to https://github.com/dart-lang/tools.

package: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/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);
  });
}