2 ms·
I'm thinking: * require the broken RSpec * create a new module called Broken::RSpec * iterate through each member of the RSpec namespace (methods a
by JonnieCache 16y ago
I'm thinking:
* require the broken RSpec
* create a new module called Broken::RSpec
* iterate through each member of the RSpec namespace (methods and variables), and copy it to the new module
* unload RSpec
* require the stable RSpec
I'm fairly sure that I have done all of these things separately (iterating/copying object members, unloading classes) in ruby before. I'm probably wrong though. Just thinking aloud.
When refinements come along in ruby 2.0 this will be easy.
EDIT: Or use ruby_parser to suck the AST out of the very broken rspec source files themselves and instance_eval it inside Broken::RSpec. Danger is my middle name.