On Feb 16, 2005, at 10:07 AM, Anders Bengtsson wrote: > Very cool! I was looking for something similar to this some time ago, > but figured it would be too much work to implement it. I'm glad you > made > a different decision! :) I've actually done this, in half-hearted ways, three separate times in three separate apps ... So this lib is my attempt to do it once, and correct ... > Did you examine the possibility to override the methods in the standard > IO and File classes, so that it could be more transparent? More transparency is important, yeah, but maybe I won't want to redefine methods on already existing classes & modules. Method coverage is currently really spotty, so if I redefined, say, File.mtime but not File.ctime, your test code would be mixing up its calls against the MockFileSystem with its calls to the real file system ... pretty confusing, I think. Might be better to simply undefine and redefine those constants: Object.send( :remove_const, :File ) class File ... end Though it's quite possible that that could be really nasty, too. I'll have to poke around for a while to see. Francis Hwang http://fhwang.net/