From: Robert Klemme Date: 2006-06-06T23:14:33+09:00 Subject: Re: Ruby and the Open-Closed Principle 2006/6/6, Mat Schaffer : > >> That's why you want to write tests. > > > > Yes, but that's not necessarily enough. You can't test in advance > > every scenario where someone might, later on, have written a new core > > method with the same name as yours. > > I think Codeblogger was trying to say that when someone does write > that function your test will either fail because your code no longer > does what the test intends, or it will pass, in which case the code > will respond accurately even with the new core method. So there's no > problem. This won't help if other code breaks because *you* redefined a core method. Also, the pure test failure might not give you a good indication where to look. Such bugs are hard to find and fix. robert -- Have a look: http://www.flickr.com/photos/fussel-foto/