file_testing 2.1.0

  • Readme
  • Changelog
  • Installing
  • 85

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);
});

2.1.0 #

  • Changed dependency on package:test to package:test_api
  • Bumped Dart SDK constraint to match package:test_api's requirements
  • Updated style to match latest lint rules from Flutter repo.

2.0.3 #

  • Relaxed constraints on package:test

2.0.2 #

  • Bumped dependency on package:test to version 1.0

2.0.1 #

  • Bumped Dart SDK constraint to allow for Dart 2 stable

2.0.0 #

  • Removed record_replay_matchers.dart from API

1.0.0 #

  • Moved package:file/testing.dart library into a dedicated package so that libraries don't need to take on a transitive dependency on package:test in order to use package:file.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  file_testing: ^2.1.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:file_testing/file_testing.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
91
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
85
Learn more about scoring.

We analyzed this package on Nov 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Primary library: package:file_testing/file_testing.dart with components: io.

Health suggestions

Fix lib/src/testing/core_matchers.dart. (-0.50 points)

Analysis of lib/src/testing/core_matchers.dart reported 1 hint:

line 7 col 1: 'package:test_api/test_api.dart' is deprecated and shouldn't be used. package:test_api is not intended for general use. Please use package:test..

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/google/file.dart/packages/file_testing was unreachable.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and file_testing.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
meta ^1.1.2 1.1.8
test_api ^0.2.2 0.2.11
Transitive dependencies
async 2.4.0
boolean_selector 1.0.5
charcode 1.1.2
collection 1.14.12
matcher 0.12.6
path 1.6.4
pedantic 1.8.0+1
source_span 1.5.5
stack_trace 1.9.3
stream_channel 2.0.0
string_scanner 1.0.5
term_glyph 1.1.0