in reply to A fresh new module on CPAN: Test::MockFile::Light

Nice work - but...
a rose is a rose is a rose -- Gertrude Stein

why would I mock it?

why would I mock a file, since everything is a file?

Your module is a file,
$0 is a file, perl is a file,
the content of __DATA__ is a file within a file,
and the content of a "mock file" certainly is - a file...

*scratch_head*

Could you outline a scenario where this module might be useful?

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: A fresh new module on CPAN: Test::MockFile::Light
by mayaTheCat (Scribe) on Sep 11, 2007 at 06:03 UTC
    You may be right, but ...

    ... I like minimalism; Although we all live in a sea of files - namely the file system - I do not like to create small temporary files which will only exist during script run.

    A possible scenario is that you have a module which writes formatted data on some file, and you want to test the module, in which case you need to test the content of the file. You can use the module to mock file during testing.

    You can find examples on the documentation of Test-MockFile-Light.

    Oguz

    ---------------------------------
    life is ... $mutation = sub { $_[0] =~ s/(.)/rand()<0.1?1-$1:$1/ge };