RE: Test::Builder feature request

2007-01-11 Thread Ovid
--- [EMAIL PROTECTED] wrote: > I think code under test that has "if I'm under test" statements is > intrinsically weak. You want to test "what it does", not "what it > does when under test". Changing the code for testing means your not > really testing it , your testing a variation of it. I compl

RE: Test::Builder feature request

2007-01-11 Thread leif . eriksen
You don’t have to use objects to get the same end effects as mocking objects. Mocking is a technique for OO code to achieve the following aim - "the code under test should not be changed to test it" The code _should_ (I'd prefer _must_ but lets not get into absolutes just yet) NOT be a

Re: Test::Builder feature request

2007-01-11 Thread chromatic
On Thursday 11 January 2007 06:30, Ovid wrote: > Quite often people will write code which tests to see if > $ENV{HARNESS_ACTIVE} is true.  For example, this allows them to not > email support from their code while testing.  This variable is set in > Test::Harness.  However, this causes a problem w

Re: Test::Builder feature request

2007-01-11 Thread Smylers
Nadim Khemir writes: > On Thursday 11 January 2007 18:04, Ovid wrote: > > > > Just one, Shouldn't the mailer "object" be mocked and the mail > > > sending checked? > > > absolutely, but how do you know to mock it or really send the email > > unless you know that you're being run by tests? > > Ar

Re: Test::Builder feature request

2007-01-11 Thread Nadim Khemir
On Thursday 11 January 2007 18:04, Ovid wrote: >> Just one, Shouldn't the mailer "object" be mocked and the mail >> sending checked? >absolutely, but how do you know to mock it or really send the email >unless you know that you're being run by tests? Aren't you mixin contexts here? The code to be

Re: Test::Builder feature request

2007-01-11 Thread Ovid
--- Paul Johnson <[EMAIL PROTECTED]> wrote: > Now I can see uses for knowing whether or not you are being run as > part > of an installation, or in some automated environment, and I can > imagine > someone would have a use for HARNESS_ACTIVE, though I can't see it > myself, but I'm not sure this i

Re: Test::Builder feature request

2007-01-11 Thread Paul Johnson
On Thu, Jan 11, 2007 at 09:04:54AM -0800, Ovid wrote: > --- Nadim Khemir <[EMAIL PROTECTED]> wrote: > > > On Thursday 11 January 2007 15:30, Ovid wrote: > > > Quite often people will write code which tests to see if > > > $ENV{HARNESS_ACTIVE} is true. For example, this allows them to not > > > e

Re: Test::Builder feature request

2007-01-11 Thread Ovid
--- Nadim Khemir <[EMAIL PROTECTED]> wrote: > On Thursday 11 January 2007 15:30, Ovid wrote: > > Quite often people will write code which tests to see if > > $ENV{HARNESS_ACTIVE} is true. For example, this allows them to not > > email support from their code while testing. This variable is set >

Re: Test::Builder feature request

2007-01-11 Thread Nadim Khemir
On Thursday 11 January 2007 15:30, Ovid wrote: > Quite often people will write code which tests to see if > $ENV{HARNESS_ACTIVE} is true. For example, this allows them to not > email support from their code while testing. This variable is set in > Test::Harness. However, this causes a problem wh

Test::Builder feature request

2007-01-11 Thread Ovid
Quite often people will write code which tests to see if $ENV{HARNESS_ACTIVE} is true. For example, this allows them to not email support from their code while testing. This variable is set in Test::Harness. However, this causes a problem when someone accidentally does this: perl t/email_supp