I've developed a gem which is to use inside a model by adding acts_as_gmappable
and it's possible to pass options in the declaration.
Now that I want to write tests with Rspec, I'm stuck for all model related functions:
- check if geocoding was properly done
- check I create a proper json from all database entries
- etc ...
I know how to do these inside a Rails app but definitly not for a gem. Any track?
I managed to do this by reading the excellent book of Jose Valim:
http://plataformatec.com.br/crafting-rails-applications/
He describes how he tests his gem using his engine builder:
来源:https://stackoverflow.com/questions/5211971/rspec-test-gems