On Feb 1, 2007, at 7:16 AM, Pit Capitain wrote:

> Ola Bini schrieb:
>> The problem is really code I don't have control over. I don't want  
>> to duplicate the code written, but there is no way to change that  
>> code from using classes to modules.
>
> OK. Could you tell us more about what you are trying to do?

I ran into a similar situation yesterday.  Here's my use case.

I'm working on some code organized like this:

module NamespaceModule
   class Parent
     class Child1 < Parent; end
     class Child2 < Parent; end
     class Child3 < Parent; end
     # ...
   end
end

In my tests, I didn't want to use the long name of everything.  I  
included the NamespaceModule to shorten referring to the Parent, but  
the same trick doesn't work for the child classes.

I ended up adding a const_missing() to my TestCase that did the  
lookup for me.

James Edward Gray II