ANN: MockFS 0.1.2

F

Francis Hwang

Hi everyone,

MockFS lumbers forward with its newest release, 0.1.2. Besides a
liberal heaping of bugfixes, this version adds override.rb, which does
some convenient but possibly dangerous redefining of global constants
and methods. Ooh, danger!

http://rubyforge.org/projects/mockfs/

== What's MockFS?

MockFS is nothing less than an attempt to simulate a file system in
memory for the purposes of testing. I wrote it for my own use, because
I write lots of tests and sometimes I get sick of cleaning up test
files. It's a lot simpler to just simulate the disk in memory and drop
the whole thing when you're done with your test.

It's not complete by a longshot, but it's complete enough that I'm able
to use it to help me write tests for production code--most notably, for
Rhizome.org, a community website that gets more than a million
pageviews a month.

== What's new in 0.1.2?

* First, a lot of little things have been fixed. MockFS now has a
better understanding of file permissions, of paths, and the multiple
ways that File, FileUtils, and Dir allow the same method to be called
through class or instance methods.

* I've also added override.rb, which redefines File, FileUtils, and
Dir. This is so your code doesn't have to reference MockFS directly;
the test cases can include override.rb and reference the mock file
system that way.

override.rb also includes a redefinition of Kernel.require, so that if
a file doesn't exist in the real file system, Kernel.require will look
for it in the mock file system. This might be useful in cases where you
have configuration files written in Ruby, and would like to swap them
out during testing.

Pretty much everything in override.rb is experimental, so I'd urge
caution in including the file.

== Help me make this useful for you

I'm putting this out in the hopes that it will be useful right now to
others, but also as a way of soliciting specific bug reports. I don't
expect to fill in the entire necessary functionality overnight, but if
people submit targeted bug reports about specific cases and methods, I
can fill those in first.

Thanks,
Francis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top