Build before test.
Deal with argument with space by quoting all variables (bash).

Reference: http://stackoverflow.com/questions/1983048/passing-a-string-with-spaces-as-a-function-argument-in-bash