From: nathaniel@... Date: 2002-03-09T08:52:38+09:00 Subject: Ruby/Mock namespace question I asked Nat Pryce a week or so ago if he would port Ruby/Mock to Test::Unit. He gladly agreed (and has now done so; look for it RSN). An issue was brought up, however, as to the namespace the mocking package should live in. With his agreement, I've included most of the conversation below, and am soliciting feedback from the community at large. Nat's comments are preceded by '>'. > I thought I'd change the API to match that of Test::Unit, > putting the mock classes in the Test::Mock package and > the "test/mock.rb" file." Hmmm... do you think it should be in Test::Mock or Test::Unit::Mock? My (current, subject-to-change) vision is that the Test module will contain sub-modules related to various types/stages of testing, such as Test::Unit and Test::Acceptance. It seems mocking is specific to unit testing, but I could certainly be convinced otherwise. It's your call either way, of course. > I've put it into the Test::Mock module because my experience > is that tools don't fit neatly into just one stage of testing. > I have seen JUnit used for acceptance testing, for example. > I'd prefer the Test namespace to contain submodules for > different testing *techniques*, such as unit tests, mock > objects, code coverage, profiling, GUI automation, etc." Hmmm... good point. I definitely agree about things not fitting neatly in to categories; sometimes the categories seem very arbitrary indeed. Our company has used JUnit to do acceptance testing before, and even in the acceptance testing framework I have for Ruby (which I hope I might be able to genericize and release some day) I use Test::Unit assertions. So this point is well-taken. > Also I don't like overly large module paths but that might > just be because I've been a java.programmer.for.far.too.long.now :-) tell.me.about.it.because.i.have.been.too :-) > Let me know your thoughts on this though -- I can be > persuaded otherwise. I'm at the point where I'm not sure which it ought to be... would you be OK with elevating this particular discussion to the ruby-talk mailing list? It seems like others might have opinions and good reasons for one way or the other, and I feel like I'd be better able to formulate an opinion after hearing a few more sides. I can put together a summary of what we've discussed so far and post it if you're agreeable. > That's a great idea. The only other point I'll make is that the mocking package does have a dependency on Test::Unit, so perhaps the module it lives in should reflect that. But perhaps not. My guess is there are a lot of opinions on the namespace issue in the community (I know categorization in RubyGems caused some interesting discussions), and I'd like to hear them all. Of course, in the end, it will be Nat's call as to how exactly Ruby/Mock deals with it. Thanks, Nathaniel <:((>< + - - | RoleModel Software, Inc. | EQUIP VI