On 3/9/07, David Cantrell <[EMAIL PROTECTED]> wrote:
I have a similar problem with Net::Random.
Suggestions on how to implement the test would be *most* welcome.
I wrote Test::MockRandom for this kind of thing -- it mock rand() to
replace random output with non-random output. You could apply the
same approach by mocking/overriding the underlying source of random
input.
That said, for Net::Random, I don't see why you need to confirm
randomness -- all the API is promising is to retrieve "X" from a net
source which purports to be random and then manipulate it. For the
purpose of testing the min/max and get parts, just mock LWP's response
and provide a pre-set chunk of data. (See Test::Mock::LWP -- I
haven't used it as I had already implemented the same kind of thing
but it seemed useful.)
David