FileSubject

FileSubject.new

FileSubject.new(file, meta)

Creates a FileSubject asserting against the given file.

Method: FileSubject.new

PARAMETERS

file:

(File) the file to assert against.

meta:

(ExpectMeta)

RETURNS

FileSubject object.

FileSubject.equals

FileSubject.equals(expected)

Asserts that expected references the same file as self.

This uses Bazel’s notion of File equality, which usually includes the configuration, owning action, internal hash, etc of a File. The particulars of comparison depend on the actual Java type implementing the File object (some ignore owner, for example).

NOTE: This does not compare file content. Starlark cannot read files.

NOTE: Same files generated by different owners are likely considered not equal to each other. The alternative for this is to assert the File.path paths are equal using [FileSubject.path()]

Method: FileSubject.equals

PARAMETERS

expected:

undocumented

FileSubject.path

FileSubject.path()

Returns a StrSubject asserting on the files path value.

Method: FileSubject.path

RETURNS

StrSubject object.

FileSubject.short_path_equals

FileSubject.short_path_equals(path)

Asserts the file’s short path is equal to the given path.

Method: FileSubject.short_path_equals

PARAMETERS

path:

(str) the value the file’s short_path must be equal to.