
Testing code that's testing itself - duck
http://jeffkreeftmeijer.com/2011/testing-code-thats-testing-itself/#
======
JonnieCache
I'm thinking maybe bundler could be hacked to load an installed gem, and then
the same gem from a different (git repo or simple path) source at the same
time under different namespaces. Doesn't sound like that's outside ruby's
powers.

~~~
jkreeftmeijer
That would be a cool solution too, but Bundler _really_ doesn't like it when
you try to load multiple libraries with the same name so I'm not sure if
this'll work. I will give it a shot soon, though. :)

~~~
JonnieCache
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.

