From: Max Russell Date: 2006-11-18T00:42:37+09:00 Subject: Metaprogammatically define methods. I'm writing a harness for some tests that use watir. Rather than having to boilerplate code in the definition of each test like def test_1 load test1 end I want to read the testnames in from a file which will be easier for the user. What I'd like to do is something along this structure (which I adapted from a really good blog in metaprogramming http://invisibleblocks.wordpress.com/2006/06/14/ruby-meta-programming-and-watir/): testlist = Array.new File.open('readme.txt', 'r') do |eachline| while (line = eachline.gets) testlist << line end end #puts testlist testlist.each { |entry| code = <