de-duplicate executeAndWait() from the ruby tests.