From: Sylvain Viart Date: 2009-08-19T00:19:37+09:00 Subject: Re: unit testing generated content --0016e6d99a7f90220104716bee58 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, Hey cool seems great. I've tried to find a way of passing regexps through the block (Proc) without success. But by array it's fine too. def test_it(str) > num_lines = 4 > regexs = [/^start/, /something .*/, /^\s*$/, /^end/] > > lines = str.split("\n") > return false if lines.length != num_lines > > match_results = lines.zip(regexs).collect{|line, regex| line =~ regex} > match_results.all? > end Thanks, I will post the final assert, when It will be ready. Do you think I can group my own assertion in a module or something and load it into my testcase ? For the moment I've just added a method into the testcase, was used only here. Regards, Sylvain Viart. --0016e6d99a7f90220104716bee58--