Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mocking isolated directories #463

Open
smtlaissezfaire opened this issue Jun 17, 2021 · 1 comment
Open

Mocking isolated directories #463

smtlaissezfaire opened this issue Jun 17, 2021 · 1 comment
Assignees

Comments

@smtlaissezfaire
Copy link
Collaborator

It would be great if we could just isolate / mock one directory, then use everything else from the regular fs. This might also be a good solution for #462

An issue I ran into: I used include FakeFS::SpecHelpers in a spec, but then the calling code tried to load a model which wasn't previously loaded. The model file (in app/models/x.rb) wasn't in the fake file system.

This almost seems to be the opposite of FakeFS::FileSystem.clone.

@grosser
Copy link
Collaborator

grosser commented Jun 17, 2021

would be lots of rework afaik ... touching almost every file, so probably not going to happen
I'd usually recommend to just use Dir.mktmpdir for hard to test cases

@smtlaissezfaire smtlaissezfaire self-assigned this Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants