Proper way of testing gems

By : knoopx
Source: Stackoverflow.com
Question!

If a gem has rails dependencies, do you think it is better to write the gem tests in a way they can be run standalone or run them under a rails project?

By : knoopx


Answers

I'd say it depends on the kind of dependencies the gem needs. Eg. if it's just the ActiveRecord it's quite easy to include it into your test suite. In more complex cases you can always mock some of the needed functionality. In a really complex cases, creating a test app is better than nothing (IMO).



This video can help you solving your question :)
By: admin