I am going to start writing tests for my Fancy::Open module that needs a file to open. Test::MockObject was suggested. In reading the beginning of the documentation, I saw it can mock arrays, scalars, code, and globs, but I do not see files.
my $mock_array = Test::MockObject->new( [] ); my $mock_scalar = Test::MockObject->new( \( my $scalar ) ); my $mock_code = Test::MockObject->new( sub {} ); my $mock_glob = Test::MockObject->new( \*GLOB );
So, can Test::MockObject mock a file? If yes, how does it work? I am having a difficult time understanding the documentation.
My OS is Debian 10 (Buster); my perl versions are 5.28.1 local and 5.16.3 or 5.30.0 on web host depending on the shebang.
In reply to Can Test::MockObject mock a file? by Lady_Aleena
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |