2 ms·
Perl's Catalyst Web Framework encourage you to do it slightly different: you develop libraries for your business logic and try to make these reusable (or may b
by hippich 14y ago
Perl's Catalyst Web Framework encourage you to do it slightly different:
you develop libraries for your business logic and try to make these reusable (or may be even opensourceable on CPAN for other developers to use). These libraries will include their own test, which obviously not require you to fire your main web app and need to be tested once - when installing it on local machine.
What do not fit well into standalone libraries, goes into model (aka fat models). Again, models developed as standalone piece which could be used from command oneliners, web frontend, anything else. Tests for these often are part of web application, but testing of models should not require firing web app itself.
and last piece - controllers and views. these are integral part of web app therefore these require firing web app code to test. but controller code is very thin since it just prepare and route calls into model. views are usually just an adapter, often default scaffolded, for existing templating module on CPAN.
I bet same principle can be applied to Rails framework, but it is about community around framework which encourage you to do things in a certain way.