Using request.debug()

Version 4 by Marc Esher
on Jun 18, 2012 17:57.

compared with
Current by Marc Esher
on Jun 18, 2012 18:00.

This line was removed.
This word was removed. This word was added.
This line was added.

Changes (3)

View page history
You can\! MXUnit will create a function called request.debug() that is hooked into the same glob of debug output as the debug() function you use in your tests. Thus, in any component you're trying to test (or its dependencies, for that matter), if you're running the code from within MXUnit, request.debug() will be available.
It would look something like this:

{code:title=request.debug() example}
<cfcomponent name="MyDAO">
<cffunction name="getSomeData">
<cfset var myQuery = "">
<cfquery name="myQuery">
select foo from bar

<cfset request.debug(myQuery)>
h1. Is it turned on by default?
Yes.&nbsp; Here's how:
{code:title=Example Debugging}
{code:title=Enabling request.debug in the HTML Runner Context}
<cffunction name="testRequestDotDebug_WillPassInBothPluginAndWeb">
<cfset createRequestScopeDebug()>