CFUnit's Message Argument

View: New views
3 Messages — Rating Filter:   Alert me  

CFUnit's Message Argument

by Robert Blackburn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mike Nimer recently emailed me about a potential change to CFUnit...

Mike: "in the Asset.cfc component, can you move the MESSAGE arguments
in all of the functions to the end of the argument list.  Even though
it's not required because it's first in the list if you try to call
the method with an argument list (not using named arguments) from
cfscript it ends up being required.  By moving it down I can call
AssertEquals("abc", "abc") or AssertEquals("abc", "abc", "error
message")"

I've seen that suggestion before (was it Mark Mandel that asked about
that a while ago?), and in hind sight it would be the best way to go.
I originally modeled everything after JUnit, right down to the order
of the arguments. Of course Java has overloading, and CF does not, so
that was a bit short sighted of me.

My main concern at this point is if I change it now, then everyone
already using CFUnit will have to change all their unit tests too, so
I was not sure which would be considered the bigger annoyance - the
poorly ordered arguments or having to rewrite every unit test.

In lieu of his suggestion I figured I would post a message on the
mailing list to see what the consensus is on this change.

thx

--
Rob Blackburn
http://www.rbdev.net

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:51:2695
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/51
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:51
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.51
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Re: CFUnit's Message Argument

by Mark Mandel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Yup it was me ;oD

I'm totally for it.

Of course you could do something very similar to what you did with
TestCaseExtra and have an extended version that just changes the order
of how things are organised.

Then people have the choice.

It's not ideal, but it works.

Mark

On 6/14/06, SkorPiun <skorpiun@...> wrote:

> Mike Nimer recently emailed me about a potential change to CFUnit...
>
> Mike: "in the Asset.cfc component, can you move the MESSAGE arguments
> in all of the functions to the end of the argument list.  Even though
> it's not required because it's first in the list if you try to call
> the method with an argument list (not using named arguments) from
> cfscript it ends up being required.  By moving it down I can call
> AssertEquals("abc", "abc") or AssertEquals("abc", "abc", "error
> message")"
>
> I've seen that suggestion before (was it Mark Mandel that asked about
> that a while ago?), and in hind sight it would be the best way to go.
> I originally modeled everything after JUnit, right down to the order
> of the arguments. Of course Java has overloading, and CF does not, so
> that was a bit short sighted of me.
>
> My main concern at this point is if I change it now, then everyone
> already using CFUnit will have to change all their unit tests too, so
> I was not sure which would be considered the bigger annoyance - the
> poorly ordered arguments or having to rewrite every unit test.
>
> In lieu of his suggestion I figured I would post a message on the
> mailing list to see what the consensus is on this change.
>
> thx
>
> --
> Rob Blackburn
> http://www.rbdev.net
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:51:2696
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/51
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:51
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.51
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Re: CFUnit's Message Argument

by Sean Corfield :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 6/13/06, SkorPiun <skorpiun@...> wrote:
> I've seen that suggestion before (was it Mark Mandel that asked about
> that a while ago?), and in hind sight it would be the best way to go.
> I originally modeled everything after JUnit, right down to the order
> of the arguments. Of course Java has overloading, and CF does not, so
> that was a bit short sighted of me.

FWIW, cfcUnit puts message at the end of the argument list (which was
the right decision for ColdFusion, of course).

Frankly, there's a huge difference in the code quality and structure
between cfUnit and cfcUnit - cfUnit is really nasty code and really
hard to follow, presumably because it's very close to jUnit (which is
also a steaming pile of...). cfcUnit implements the concepts of jUnit
but does it in a much more idiomatic way with much cleaner code.

I'm not criticizing you Rob because I know you took over cfUnit as,
effectively, a "dead" project and resurrected it and the core codebase
isn't yours.

I use cfUnit every day - because of the ant / builder integration in
Eclipse - but I recommend cfcUnit to everyone who doesn't specifically
want to do that integration. I said this at the time and I'm going to
say it again: I'm disappointed you decided not to throw your weight
behind Paul's cfcUnit and help move that forward as *the* unit testing
framework for ColdFusion.

I don't know if you've listened to Hal and Jeff's Out Loud where they
talk about frameworks competing and wish that authors would work
together to unify things. I really think you should consider working
with Paul to extend his codebase to provide the ultimate testing
framework.

Sorry. Rant over.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:51:2698
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/51
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:51
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=17837.14401.51
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54