BoxLang: Our new JVM Dynamic Language made by Ortus! Check it out: https://www.boxlang.io

addAssertions() method failure on adding CFCs

Description

Adding custom assertions from a cfc fails using the addAssertions() method:

public any function beforeAll() { variables.startDate = dateAdd("m",-1,Now()); variables.endDate = Now(); addAssertions("framework.plugins.testbox.Assertions"); return this; }

With the following error message:

Message Can't cast Complex Object Type Array to String Detail Use Built-In-Function "serialize(Array):String" to create a String from Array Stacktrace testbox\system\testing\BaseSpec.cfc: line 348 346: var methodArray = structKeyArray( oAssertions ); 347: for( var thisMethod in methodArray ){ 348: this.$assert[ thisMethod ] = oAssertions[ methodArray ]; 349: } 350:

The bug appears to be on line 348 where you are trying to use the actual array as the key rather than the actual key variable, the line should be:

this.$assert[ thisMethod ] = oAssertions[ thisMethod ];

Gliffy Diagrams

Activity

Show:

brian pickensApril 8, 2014 at 1:13 PM

In addition to this issue I am trying to solve why, after the methods are copied to 'this.$assert', and I verified that actually happened, those methods are still not available to me in my test bundle. If I come across another bug Ill post a separate ticket for it.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Sentry

Created April 8, 2014 at 1:10 PM
Updated April 8, 2014 at 4:32 PM
Resolved April 8, 2014 at 4:32 PM

Flag notifications