[Wtr-general] looping test cases?
Chris McMahon
christopher.mcmahon at gmail.com
Tue Oct 10 11:27:10 EDT 2006
On 10/10/06, Jeff Fry <jfry at lyris.com> wrote:
>
> Hi,
> I am trying to do something like:
>
> def test_random_stuff
> 1.upto(100) do |stuff|
> #each test is somewhat randomized
> assert_no_match(certain error)
> end #do
> end #test_random_stuff
>
> current behavior:
> test/unit exits the test case as soon as an assertion fails.
>
> what I'd *like *to end up with is a test that passes or fails and then
> runs again either way.
> It might generate a list of pass/fail results from my random tests,
> something like:
> dataset 1 pass
> dataset 2 pass
> dataset 3 fail
> dataset 4 pass
> dataset 5 fail
> ...
> dataset 100 pass
>
>
> How would you suggest going about this?
> Thanks,
> Jeff
>
def test_random_stuff
1.upto(100) do |stuff|
begin
#each test is somewhat randomized
assert_no_match(certain error)
puts "passed"
rescue => e
puts "error: " + e.to_s
end #begin
end #do
end #test_random_stuff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061010/2127ec34/attachment.html
More information about the Wtr-general
mailing list