http://qs321.pair.com?node_id=11121951


in reply to Re: Can Test::MockObject mock a file?
in thread Can Test::MockObject mock a file?

fancy_open opens a file, runs the contents through a while that chomps it, and prepends the lines with the string in the before option and/or appends the string in the after option. It returns an array.

So what I need is a file to open and manipulate. The contents of the file do not need to be spectacular, and I will probably use my favorite dummy list.

red orange yellow spring green teal cyan azure blue violet magenta pink white black gray

I am willing to use an actual file for the test, but I am unsure where to put it. Do I put it in the t directory with the test? Is it better to use a mock file instead? I would like to get this module's tests written first. I am finally learning how to write tests, so please bear with me for a short while?

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