GitPlatform class Testing

The platform facts the process backend adapts to: the operating system, the path spelling, the environment variables commands receive and the directory relative paths hang from.

windows, linux and macos describe those systems explicitly, with an empty environment and no current directory. Tests build their own — a custom environment and currentDirectory run Windows or POSIX behavior on any machine without touching the host.

Constructors

GitPlatform({required GitOperatingSystem operatingSystem, GitPathStyle? pathStyle, Map<String, String>? environment, String? currentDirectory})
Creates a platform of operatingSystem, with the pathStyle derived from it unless given, environment copied and made unmodifiable, and currentDirectory as the anchor relative paths hang from.

Properties

currentDirectory → String?
Directory relative paths resolve against, or null when this platform stands for no working directory.
final
environment → Map<String, String>
Environment variables commands receive, unmodifiable.
final
hashCode → int
The hash code for this object.
no setterinherited
operatingSystem → GitOperatingSystem
Operating system commands run on.
final
pathStyle → GitPathStyle
Spelling of the paths commands exchange with this platform.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

linux → GitPlatform
Linux, with the POSIX path style and an empty environment.
final
macos → GitPlatform
Apple macOS, with the POSIX path style and an empty environment.
final
windows → GitPlatform
Microsoft Windows, with the Windows path style and an empty environment.
final