Add testing for rebuild command