alexreisner/geocoder

Allow `address_components_of_type` for Geocoder::Result::Test

loqimean opened this issue · 1 comments

Expected behavior

To have all methods or only this

Actual behavior

undefined method `address_components_of_type' for #<Geocoder::Result::Test:..

Steps to reproduce

mock request and run a test that calls an address_components_of_type method

Environment info

No one

  • Geocoder version: latest
  • Rails version: 7
  • Database (if applicable): postgresql

Hmm, so this method is defined for the Google result classes because it's useful for handling the format in which Google's APIs return data. It's not relevant to other result types that have different structures. The Test result class reflects what's in the Base class. I'm not sure what you're trying to do that this is an issue. You might want to look at the Google unit tests to see how mocking is usually done in the test suite.