I have transferred this message from one I sent to Brad. Sorry, I am still finding my feet with Slack…
So, when I go to my test template with:
<cfset r = new testbox.system.TestBox("com.bddTests.BDDTest1")>
<cfoutput>#r.run()#</cfoutput>
I get the following error:
Object of type class coldfusion.runtime.Struct cannot be used as an array
The error occurred in C:/Users/Charles Robertson/Documents/commandbox-jre-win64-4.7.0/testbox/system/reports/assets/simple.cfm: line 518
Called from C:/Users/Charles Robertson/Documents/commandbox-jre-win64-4.7.0/testbox/system/reports/assets/simple.cfm: line 244
Called from C:/Users/Charles Robertson/Documents/commandbox-jre-win64-4.7.0/testbox/system/reports/SimpleReporter.cfc: line 53
Called from C:/Users/Charles Robertson/Documents/commandbox-jre-win64-4.7.0/testbox/system/TestBox.cfc: line 415
Called from C:/Users/Charles Robertson/Documents/commandbox-jre-win64-4.7.0/testbox/system/TestBox.cfc: line 164
Called from C:/ColdFusion11/cfusion/wwwroot/nationallottery/bdd-test/index.cfm: line 3
516 : <cfif structKeyExists( local.thisSpec, "message" )>
517 : <div>
518 : <cfif arrayLen( local.thisSpec.failOrigin )>
519 : <div><pre>#local.thisSpec.failOrigin[ 1 ].raw_trace#</pre></div>
520 : <div class="pl-5 mb-2 bg-light">
BDDTest1.cfc:
<cfscript>
component {
// executes before all suites
function beforeAll() {
}
// executes after all suites
function afterAll() {
}
// All suites go in here
function run() {
describe("A suite", function() {
it("contains spec with an awesome expectation",
function() {
expect( true ).toBeTrue();
}
);
it("contains a spec with more than 1 expectation",
function() {
expect( [1,2,3] ).toBeArray();
expect( [1,2,3] ).toHaveLength( 3 );
}
);
});
}
}
</cfscript>