Rails engines testing -


we using rails engine has able access models , behavior containing application, because we're testing in dummy application can't test things , end mocking , stubbing entire left half of world out write simple tests.

is there way, via configuration, code or ritual sacrifice of farm animal, can have our engine tests run in context of containing application rather in dummy test application?

i approach differently

  • establish interface consuming application should observe. assume valid application use gem on way it's supposed to
  • given defined interface, application using gem should same gem standpoint. having mock application sets example domain tested in context of gem becomes ok. don't mock anything, create application actual models or layer required interact engine

if there's no way define how used, or still want enable consumers test integration points, provide test helpers. rack-rest, provides test infrastructure rack users.

those can required , used on whatever testing framework being used app , can used if deemed required.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -