[rspec-users] How to test modules and custom validators

Piter Fcbk piter.fcbk at gmail.com
Wed Aug 3 12:08:42 EDT 2011


I'm trying to have most of the important stuff tested and in order to do
that I run in front of some stuff I'm not quite sure which is the best way
to test them.
At this time I am having question around how to test modules and the custom
validators (the typical email format validator for example).

To test a module the best I saw up to now was finded here:
http://stackoverflow.com/questions/512466/how-to-implement-an-abstract-class-in-ruby
In the before he creates a new class and import the module to test, Then,
using the class created, he test the module methods.
Is this the recommended way to go?

About testing validators I guess something like what was done with the
models could also work but again not sure if its the way to go or if its
totally wrong.

Some advices on this matters will be really appreciated,

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110803/91225731/attachment.html>


More information about the rspec-users mailing list