I use Ruby with Selenium to do test automation on a web application that has a MySQL DB behind it. I need a good way to load data into the DB from a Ruby script. So far in my research I have found using an export of the DB tables in CSV files and then loading the files back into the DB before running a test that requires the data. To connect to the DB I have found the gems mysql2 and net/ssh/gateway.

Actually just remembered the reason I wrote that - in a case where you want to start with a clean database, you can have a script delete all tables from the DB and then use the mysqldump to create the schema and insert the data.
–
Suchit ParikhNov 15 '12 at 18:35