You can use the power of ruby blocks:

def run_test(name, &block)
  yield
rescue
  puts "#{name} failed"
end

run_test "test1" do
  # run test 1
end

run_test "test2" do
  # run test 2
end

-- 
Posted via http://www.ruby-forum.com/.