Fix a misuse of inreplace method, use an assert method in the test block, put the arguments of prefix.install together and arrange some codes.