-
Notifications
You must be signed in to change notification settings - Fork 9
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
Test::MockFileSys Prototype #115
Labels
Feature Request
New feature or request
Comments
then we could have my $fs = Test::MockFileSys->new;
$fs->file( '/a/b/c' );
$fs->file( '/a/b/c' )->write( q[content] );
...
$fs->file( '/a/b/c' )->read;
$fs->file( '/a/b/c' )->unlink;
|
I think there are limits here.... how is that better than |
# Grabs existing objects?
my $fs = Test::MockFileSys->new; # Singleton Only one at a time.
# Just mock not there
$fs->dir('/foo');
$fs->file('/foo/bar');
# make the thing and set perms, etc.
$fs->write_file('/foo/bar', "", { perms => 0755 });
$fs->symlink('data', '/foo/link');
$fs->mkdir( '/foo', 0755); # Auto mocks in strict mode.
# automock in strict mode.
symlink('data', '/foo/link');
mkdir '/foo', 0755;
chmod 0755, '/foo/bar';
unlink '/foo/link';
$fs->overwrite('/foo/bar', "new stuff"); # Also a getter with no 2nd arg.
# Get the object
$fs->path('/foo/bar');
# unmock the thing.
$fs->unmock('/foo/bar'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: