From: Gregory Seidman Date: 2006-06-12T05:33:42+09:00 Subject: Re: Is there a better way... On Mon, Jun 12, 2006 at 05:03:43AM +0900, James McCarthy wrote: } Is there an neater way to achieve this without using that clunky eval } and inline substitution? } } def test_confirmation(object, test_attribute, test_values = {}, } attributes = {}) } instance = eval("#{object}.new(attributes)") } test_values.each do |value| } instance.send("#{test_attribute}=", value) } instance.send("#{test_attribute}_confirmation=", value) } assert !instance.save } assert instance.errors.invalid?(test_attribute) } end } end } } Just feels a little clunky and wanted some pointers to improve my ruby. } Any thoughts would be useful. Take a look at http://redcorundum.blogspot.com/2006/05/kernelqualifiedconstget.html --Greg