Test case names in xUnit have better definitions

Description

Updated the test names anatomy to the following in xUnit mode

  1. A method is a test case if it is annotated with the word test

  2. It is a method that begins or ends with the word test

This has some departures from MXUnit where all public methods are test cases.

Original Ticket

These two bullet points taken from here: http://wiki.mxunit.org/display/default/Anatomy+of+a+TestCase

  • The filename either starts or ends with "Test"

  • The TestCase can contain any number of public methods. Those public methods are considered tests regardless of their name, and MXUnit will run them as tests. Failures will be recorded as failures; errors as errors; and successes as successes

The TestBox compat runner currently has it backwards and runs every CFC, but only methods with the word test in them.

Activity

Show:
Adam Cameron
January 21, 2014, 8:32 AM

This issue prevents us from using TestBox, as one of our not-Test CFCs has an init() method which requires an argument, which is fine when we call it as we always init() it with said argument.

However TestBox uses new to create its test objects, and new calls init() if it exists... and given TB is not passing any args with the new call, the init() call breaks, which halts the test run in its tracks.

If you weren't using new, this particular issue situation would not be a problem.

Luis Majano
January 21, 2014, 6:52 PM

Adam, where is this?

Adam Cameron
January 21, 2014, 7:25 PM

Argh, sorry... pls hold... ummm...

It might have been this bit:

In TestBox.cfc, getBundle()

I sound vague as I'm not on the same computer as this morning, and I don't have any of this stuff set up, so am just fishing around in the source code. But pretty sure that was it. it was def a call like

If I changed it to a createObject(), it worked around my issue.

Luis Majano
February 3, 2014, 8:30 AM

need to change the fix version

Luis Majano
February 3, 2014, 8:34 AM

updated ticket info

Fixed

Assignee

Luis Majano

Reporter

Brad Wood

Labels

None

Fix versions

Priority

Major
Configure