# convert_csv_to_testlink.rb
#
# author: Cynthia Sadler
# usage: ruby convert_csv_to_testlink.rb infile.csv outfile.xml
#
# where infile.cvs is a comma-separated-value file with four fields:
# name, summary, steps, expected results
#
# The steps field and expected results field may have multiple steps. If
# multiple steps are used, use newlines to delimit the steps, and enclose
# entire field with quotes. E.g., here is a sample row with multiple steps:
#
# "Sample test case","Verify something.","0. PREREQ: delete previous stuff.
# 1. Do something.
# 2. Do another thing.","A. Verify this.
# B. Verify that."
#
require 'rubygems'
require 'csv'
$infile = ARGV[0]
$testlinkxml = ARGV[1]
$temp = Array.new
$testdata = Array.new
$beginning = '