Skip to content

Feature request: mockable file system? #16

@Fuco1

Description

@Fuco1

EDIT: This functionality is now part of the assess project, check it out!


I have no idea how to implement this properly, but it would be really cool if I could run tests inside a "faked file system".

Couple solutions:

One solution would be to mock all the functions for file-system access to operate over some known data... the problem is finding those functions and managing their interactions. Probably the most robust solution but I think pretty much impossible to implement.

Other solution: we could just create the requested file structure on the disc (say in /tmp), set the default directory there and let the code work normally. The downside is that all the tested code would need to work with relative paths (which might not be that bad, most programs don't work with hard-coded paths anyway).

Some nice syntax to make directory structure and specify file content would also be cool.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions