Pipeline.Test.FileSystem behaviour (pipeline v0.0.1)

View Source

Behaviour for mocking file system operations in tests.

Summary

Callbacks

Check if file exists

List files in directory

Create directory path recursively

Read a file from the file system

Write content to a file

Callbacks

exists?(path)

@callback exists?(path :: String.t()) :: boolean()

Check if file exists

ls(path)

@callback ls(path :: String.t()) :: {:ok, [String.t()]} | {:error, term()}

List files in directory

mkdir_p(path)

@callback mkdir_p(path :: String.t()) :: :ok | {:error, term()}

Create directory path recursively

read(path)

@callback read(path :: String.t()) :: {:ok, binary()} | {:error, term()}

Read a file from the file system

write(path, content)

@callback write(path :: String.t(), content :: binary()) :: :ok | {:error, term()}

Write content to a file