This class facilitates overriding various APIs of dart:io with mock implementations.
This abstract base class should be extended with overrides for the operations needed to construct mocks. The implementations in this base class default to the actual dart:io implementation. For example:
class MyDirectory implements Directory {
...
// An implementation of the Directory interface
...
}
main() {
IOOverrides.runZoned(() {
...
// Operations will use MyDirectory instead of dart:io's Directory
// implementation whenever Directory is used.
...
}, createDirectory: (String path) => new MyDirectory(path));
}
path
. [...]
path
. [...]
path
. [...]
path
. [...]
path
. [...]
true
if path1
and path2
are paths to the
same file system object. [...]
true
if path1
and path2
are paths to the
same file system object. [...]
true
when FileSystemEntity.watch is supported. [...]
path
. [...]
path
. [...]
path
. [...]
body
in a fresh Zone using the overrides found in overrides
. [...]
body
in a fresh Zone using the provided overrides. [...]