On 2 Jun 2007, at 01:25, A. Pagaltzis wrote:

* Andy Armstrong <[EMAIL PROTECTED]> [2007-06-01 16:25]:
I could

* generate the methods dynamically based on the Kwalitee
  modules that are installed

* generate only the current methods and add a new method
  test_against() (or whatever) that provides access to any
  named Kwalitee test

* replace the generated methods with an AUTOLOAD handler

In the test_against() or AUTOLOAD scenarios I could then make
Kwalitee tests for which the module is unavailable skip
automatically.

Thoughts?

Remember you can also combine options #1 and #3: generate methods
at compile-time and use AUTOLOAD just for skipping. Would there
be any provision for catching typos in any of these cases,
though?

Well no. And that's one of the reasons why I'd like to move away from the method-named-after-test interface entirely. I'm thinking

* create the same methods that are currently created - for backwards compatibility
* deprecate that interface
* create a new interface - kwalitee('test_name', ...) which is just a conventional method that despatches to the
  named test.

I know it's not as cute as the current interface - but cute can be surprising and I don't think a surprising interface is necessarily a good thing :)

--
Andy Armstrong, hexten.net

Reply via email to