[testbox] standalone mapping

Hi Chaps,

I’m getting myself confused here so hopefully you guys will point out the obvious mistake I’m making :slight_smile:

Here’s what I’m doing:

  • setting up Testbox for a legacy application (no frameworks) on ColdFusion 10 that has no test suite
  • I have download and extracted Testbox 2.1.0 to a non web accessible location [~/projects/coldfusion/testbox-2_1_0/]
  • So I have something like:

~/projects/coldfusion/testbox-2_1_0/testbox-2_1_0/
~/projects/coldfusion/testbox-2_1_0/testbox-2_1_0/testbox/

inside the testbox directory I have:

apidocs/
test-browser/
license.txt
test-harness/
mockbox.md
test-runner/
readme.md
testbox-2.1.0+00008-201411122116
system/
tests/

In ColdFusion Administrator I have created mapping named “testbox” to “/Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox”

In my webroot I have created a simple testrunner:

<cfset r = new testbox.system.TestBox(directory={ mapping=“unittests”, recurse=true }, reporter=“simple”)>
#r.run()#

When I run that I get:

Could not find the ColdFusion component or interface testbox.system.testing.BaseSpec.

Ensure that the name is correct and that the component or interface exists.

The error occurred in /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/TestBox.cfc: line 371

Called from /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/TestBox.cfc: line 346

Called from /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/TestBox.cfc: line 165

Called from /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/TestBox.cfc: line 96

Looking in the “/Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/” directory there isn’t a “testing” directory. BaseSpec has a path of “/Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/”. So I’m not sure where that “testing” part of “testbox.system.testing.BaseSpec” is being picked up from.

I’ve used Testbox before so not quite sure why I’m having issues today - probably something dumb I’m doing but I just can’t spot it at the moment!

Thanks :slight_smile:

John

So the first part was me being dumb - I’d inherited from “testbox.system.system.BaseSpec” instead of “testbox.system.BaseSpec” duh!

Anyway, fixed that and have a new error:

Element ‘’ is undefined in a CFML structure referenced as part of an expression.

The error occurred in /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/BaseSpec.cfc: line 75

Called from /Users/johnwhish/home/dev.ccb.any-survey.com/webroot/admin/system/testSuite/unittests/foo/fooTest.cfc: line 7

Called from /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/runners/BDDRunner.cfc: line 42

Called from /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/TestBox.cfc: line 352

Called from /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/TestBox.cfc: line 165

Called from /Users/johnwhish/projects/coldfusion/testbox-2_1_0/testbox/system/TestBox.cfc: line 96

Called from /Users/johnwhish/home/dev.ccb.any-survey.com/webroot/admin/system/testSuite/unittests/testboxrunner.cfm: line 2

73 : */

74 : function beforeEach( required any body ){

75 : this.$suitesReverseLookup[ this.$suiteContext ].beforeEach = arguments.body;

76 : }

77 :

I’m shutting the Mac down for the day and will debug it tomorrow, expect I’ll see what I’ve messed up in the morning - but if anyone has any suggestions to save me some time that would be handy :slight_smile:

John

Maybe you need some sleep :slight_smile:

Can you post your bundle, it seems something is wrong there. as that line of code is the beforeEach() reverse lookup. Meaning the closure is wrong.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com
P/F: 1-888-557-8057
Direct: (909) 248-3408

ColdBox Platform: http://www.coldbox.org

ContentBox Platform: http://www.gocontentbox.org
Linked In: http://www.linkedin.com/pub/3/731/483

Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano | twitter.com/gocontentbox

Gah! That was it :slight_smile: I knew it was something dumb I’d done. Will get some sleep.

Thanks Luis!