Open
Description
Currently we can use the ->contents
helper to update the content of a mocked file.
This is a convenient helper as of course we could also use any traditional way to write to the file.
This case is about providing two convenient helpers read
and write
which would only make sense in the context of a file (should die when used on a mocked directory and a symlink)
my $f = Test::MockFile->file( "/my/file" );
$f->write( "content" ) or die;
# maybe consider
$f->write( @lines ) or die;
$f->append( $new_line ) or die;
$f->append( @lines) or die;
my $content = $f->read;
my @lines = $f->read;