[Wtr-general] Data driven tests

Chris McMahon christopher.mcmahon at gmail.com
Mon Jan 8 13:03:35 EST 2007


On 1/8/07, Balakrishna <balakrishna.venkatappa at ionidea.com> wrote:
>
>  Hello Chris,
>
> Thanks for the response. I will try this solution. If you have an example
> of the same ,plz share it to me.
>
> Any methods to find the size of array .
>

 irb(main):001:0> ary = [5,10,15,20]
=> [5, 10, 15, 20]
irb(main):002:0> ary.length
=> 4
irb(main):003:0>

Also my question regarding the while loop does not execute the statements
> until End is reached. How do I overcome this ?
>
There are several odd things in your code.  For one, I wouldn't use global
variables, they'll cause you trouble eventually.   For another, use "puts"
instead of "printf".  Your "while" loop should fetch each row, but your
commented-out line "sth.each" is a lot more Ruby-like way to do it.

I assume by "not execute" you mean that the results of each printf are shown
only at the end?  That's probably just an artifact of your output mode.  Are
you sure that your execution mode doesn't just flush the buffer at the end
of the run?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070108/c45d4a81/attachment.html 


More information about the Wtr-general mailing list