http://qs1969.pair.com?node_id=11121949

Lady_Aleena has asked for the wisdom of the Perl Monks concerning the following question:

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.

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena