I have the following example argument in a private method that we are
using makePublic() to make it public so it's accessible directly by a
unit test:
<cfargument name="myArg" type="struct" required="false"
default="#structNew()# />
And with that, I get the following error during a unit test:
-> The MYARG argument passed to the myFunction function is not of type
struct
The "type" that is coming back for myArg is "[runtime expression]".
In looking at makePublic(), basically a string output copy of the
private method is being made and then passed back. In making that
copy, the arguments string is generated by constructArgumentTags(),
and then the result of that is being #-evaluated while constructing
the string output copy of the entire method. Here is the call for the
arguments string:
#s_argTags#
This is going to have the side-effect of evaluating any things in the
arguments string that can be evaluated, which seems to be the place
where the issue is at least symptomatically. Removing that line
actually gets rid of the error. A co-worker suggested perhaps
something might be wrong with getMetadata(), as a root cause, but we
haven't looked into it further.
Is this copy of the arguments as a string and the subsequent
#s_argTags# call necessary?.
Thanks for any help/info.
-- David
-- David
--
You received this message because you are subscribed to the Google Groups "mxunit" group.
To post to this group, send email to mxu...@googlegroups.com.
To unsubscribe from this group, send email to mxunit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mxunit?hl=en.
Thanks for the response. While this is a work-around to get
makePublic() to not cause a problem, it means I need to modify our
base code just so the unit test will work (for these instances) when
under normal running circumstances I don't need to.
May I ask the reason the generating of the argument string code (that
creates s_argTags) is there? It doesn't seem to need to be, at first
glace.
Thanks again,
-- David
Not sure. With your change in place, do all of MXUnit's tests pass?
>
> Thanks for any help/info.
>
> -- David
>
Well, we don't really have too many tests that use makePublic(), but
the ones we do have that use it work when I comment out that line (or
at least they show to "pass" their tests).
Thanks for the reply.
-- David
OK, thanks David.
> Thanks for the reply.
>
> -- David
>
Thanks,
-- David
No idea. It's been a long time since I wrote that code. I'll need to
remove it, run all of mxunit's own tests, and run all the tests on all
of my projects to see what the effects are.
Marc
>
> Thanks,
-- David
On Dec 13, 5:48 pm, Marc Esher <marc.es...@gmail.com> wrote:
> On Tue, Dec 13, 2011 at 6:18 PM, David Sifford
>
I applied your change and pushed to the developer branch on github.
All mxunit tests passed on CF8 and CF9. Possibly the args were
necessary when I wrote that, which was when I still developed on 6.1.
Possibly they were not necessary at all.
If this change breaks things, we'll hear about it eventually.
Thanks.
Marc
Cool, glad it seems to work...hopefully won't cause problems. Thanks
for following up with it.
-- David
You're welcome. Thanks for bringing this to my attention.
Marc
> -- David
>
> On Dec 14, 3:05 pm, Marc Esher <marc.es...@gmail.com> wrote:
>> Dave,
>>
>> I applied your change and pushed to the developer branch on github.
>> All mxunit tests passed on CF8 and CF9. Possibly the args were
>> necessary when I wrote that, which was when I still developed on 6.1.
>> Possibly they were not necessary at all.
>>
>> If this change breaks things, we'll hear about it eventually.
>>
>> Thanks.
>>
>> Marc
>>
>