The work of testing these two kinds of files is a bit more tedious. If we are testing the output of these files, then we have to place the tags in a <cfSaveContent
/>
tag pair and store the result for retrieval during the test. During the run of the test, we can run the include code or custom tag, and pull the comparison content from the storage source for comparison. That is all there is to it.
There are two other types of things we can test for with these types of code testing. We can test for variables that are set and for exceptions that are thrown.
This could be anything from a persistent variable (request, session, application) to a local variable. When using custom tags, there are times when these tags use the caller scope to set variables external to the tag. Pure object oriented guys will choke to consider this practice. There is a clear reason where using an include or custom tag is best practice. This concept makes testing...