Polished the sql tests and forced them to write to a file. Added test cases to the ruby script.