Suppose I have this very simple method in a Store model:
def geocode_address loc = Store.geocode(address) self.lat = loc.lat self.lng = loc.lng end
If I want to write some test scripts that are not affected by the geocoding service, which may not be available, have limitations, or depend on my Internet connection, how do I mock the geocoding service? If I could pass the geocoding object to this method, that would be easy, but I donβt see how to do this in this case.
Thanks!
Tristan
source share