fix unlink error when no tmp dir.
remove tmp folder to test/
add localrc to testcase
add testcase for spmrc.write