From: David Alan Black Date: 2002-02-24T21:44:05+09:00 Subject: Re: duplicate method name Hi -- On Sun, 24 Feb 2002, Stefan Schmiedl wrote: > Hi Ron. > > On Sat, 23 Feb 2002 22:57:41 -0500, > Ron Jeffries wrote: > > I just found a case in a test file where i had two tests of the same > > name. obviously one of them overrode the other and so the first test was > > "lost". > > > > Is there a famous and cool way to avoid this defect? > > this is not a defect, it is a feature. > > you could do the LaTeX thingy (\newcommand vs. \def) > and define a method which checks if the current class > already has the method and then issue a warning or whatever. Ruby already does that for you, if you run under '-w': $ ruby -we 'class X; def x;end; def x;end; end' -e:1: warning: discarding old x David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav