I was wondering about the possibility of being able to temporarily replace a class with another (to be able to easily mock a class like File for example). I found an implementation of pose_as on a posting from this list describing an implementation for pose_as: http://www.ruby-talk.org/cgi-bin/vframe.rb/ruby/ruby-talk/20008?19808-25362 Matz had followed up with showing that you can do: OldClass = NewClass This doesn't work within a set_up method (Dynamic Constant Assignment) and also doesn't let me put the old one back in the teardown. The pose_as implementation seems to have a problem or two, and before I try and debug it, is there: a) a good implementation somewhere, or b) a similarly simple way to OldClass=NewClass that I can use in a dynamic context Thanks, -Tom