Design & photography
Fun and games
Popular this week
RSS and Atom feeds
Here are the headlines from my current favourite RSS feeds.
Windows Server vulnerability requires immediate attention
Octavia E. Butler: A Few Rules for Predicting the Future (2000)
Precursor – A mobile, open source electronics platform
Transdniestria – A breakaway republic from Moldova
X Minus One: 1950s Science Fiction Radio Programs Available to Listen (2011)
PerlMonks - Newest Nodes
Can Test::MockObject mock a file?
I am going to start writing tests for my
module that needs a file to open.
Re^2: nested maps
But if there's only one such construction in a Perl program, which approach incurs more overhead?the single nasty temporary variable, orloading a CPAN module that is used only once, t...
Re^4: Can Test::MockObject mock a file?
Done and thank you! Here is my test file. I hope I wrote it correctly, and it is well formed. All the tests passed. #!perl use strict; use warnings; use v5.10.0;...
Re: Can Test::MockObject mock a file?
exists. Also, file handles can be "mocked" using
and implementing a null file handle interface, if one doesn't exist. See [https://perldoc.perl.or...
Re^3: Can Test::MockObject mock a file?
I would suggest putting that file in your t/ directory, using
to get the full path to your t/ directory, and then passing that path to your module. ...
Re^2: 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 op...