Adding a spec for the error case of scanRepository