From: Dave Thomas Date: 2002-02-26T00:24:12+09:00 Subject: Re: [ANN] TestUnit 0.1.1 Received: from lethe.cardhealth.com ([143.98.10.68]) by cardhealth.com (Lotus SMTP MTA v4.6.7 (934.1 12-30-1999)) with SMTP id 88256B6B.00541DD0; Mon, 25 Feb 2002 07:18:46 -0800 Received: (from uucp@localhost) by lethe.cardhealth.com (8.9.3 (PHNE_18546)/8.9.3) id HAA01527 for ; Mon, 25 Feb 2002 07:19:32 -0800 (PST) Received: from helium.ruby-lang.org(210.251.121.214) by lethe.cardhealth.com via csmap (V6.0) id srcAAAa01480; Mon, 25 Feb 02 07:19:29 -0800 Received: from helium.ruby-lang.org (localhost [127.0.0.1]) by helium.ruby-lang.org (Postfix) with ESMTP id 94B4D52E; Tue, 26 Feb 2002 00:19:15 +0900 (JST) Received: from zip.local.thomases.com (pragdave210.august.net [216.87.136.210]) by helium.ruby-lang.org (Postfix) with ESMTP id 74D8894 for ; Tue, 26 Feb 2002 00:19:13 +0900 (JST) Received: (from dave@localhost) by zip.local.thomases.com (8.11.2/8.11.2) id g1PFJAo29801; Mon, 25 Feb 2002 09:19:10 -0600 Date: Tue, 26 Feb 2002 00:19:15 +0900 Posted: 25 Feb 2002 09:19:10 -0600 From: Dave Thomas Reply-To: ruby-talk@ruby-lang.org Subject: Re: [ANN] TestUnit 0.1.1 Sender: dave@thomases.com To: ruby-talk@ruby-lang.org (ruby-talk ML) Message-Id: In-Reply-To: <3C7A4E59.4060800@pinkjuice.com> References: <3C7A4E59.4060800@pinkjuice.com> X-ML-Name: ruby-talk X-Mail-Count: 34784 X-MLServer: fml [fml 3.0pl#17]; post only (anyone can post) X-ML-Info: If you have a question, please contact ruby-talk-admin@ruby-lang.org; Organization: The Pragmatic Programmers, LLC User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Solid Vapor) X-Authentication-Warning: zip.local.thomases.com: dave set sender to Dave@Thomases.com using -f Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Precedence: bulk Lines: 60 Tobias Reif writes: > Dave, it would be nice if you could explain what I'm missing. OK DT> A minor incompatibility: the original toplevel 'rubyunit' aliased the DT> global constant DT> DT> TestCase = RUNIT::TestCase TR> That looks strange to me. Perhaps, but its valid. DT> so that all you had to write was DT> DT> require 'rubyunit' DT> DT> class TestFred < TestCase TR> AFAICS, the same (not having to type RUNIT::) can be achieved by TR> not including it in a module named RUNIT(?) That isn't the point. It _is_ in a module already. The 'rubyunit' extension hides that fact by aliasing a class name. TR> I thought that I either TR> a) don't use a module wrapper as namespace separator for a lib, then TR> the user doesn't have to type MODULE_NAME:: ; but then there can be TR> conflicts with other namespaces; TR> or TR> b) wrap the classes in a module to separate the namespace: then the TR> user has the choice of TR> 1) including the namespace and saving some keystrokes, which is TR> OK if there can't be a conflict because no other namspaces are TR> used, TR> or TR> 2) dont' include the namespace, type the MODULE_NAME::s, and thus TR> avoid conflicts with other lib's namespaces. TR> In your example, it looks to me as if the advantage of wrapping the TR> lib in a module RUNIT is lost by the aliasing: there could be TR> conflicts with other namespaces, but no namespace "prefix" can be used. (c) wrapping all the code, but making a hole in the wrapper in one place to make it easier for folks using the code. Creating a module adds one constant to the global namespace (the module name). Aliasing something inside the module to something on the outside adds just one more. Cheers Dave