On Wed, Dec 5, 2012 at 12:17 PM, Martin Hansen <[email protected]> wrote: > I need some hints to organize my code, so I avoid name space collision > of the method patmatch() - which happens when I run the unit test suite. > > The layout of my code is here: > > http://pastie.org/5483165
It depends on the lifetime of the association between a Seq instance and a particular #patmatch algorithm. Basically these are the options 1. all instances of Seq have the same algo (what you currently have, implemented via include) 2. an instance of Seq has an algo for its entire lifetime (can be decided any time, implemented via extend) 3. an instance of Seq can change the algorithm at will (typical case for delegation aka strategy pattern). Your tests apparently require at least 2, maybe 3 but your implementation only delivers 1. That looks like a design issue. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/ -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at https://groups.google.com/d/forum/ruby-talk-google?hl=en
