Skip to content

Commit

Permalink
fix(TestBoxMatchers): Use structCount for Adobe compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
elpete committed Jun 15, 2023
1 parent 04aefc0 commit f17fa8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/TestBoxMatchers.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ component {
*/
function toHaveSentRequest( expectation, args = {} ) {
var hyper = expectation.actual;
if ( args.len() >= 2 ) {
if ( structCount( args ) >= 2 ) {
expectation.message = args[ 2 ];
} else {
expectation.message = expectation.isNot ? "Expected to not find a request that matched the callback parameters but did." : "Expected to find a request that matched the callback parameters but did not.";
Expand All @@ -31,7 +31,7 @@ component {
var actualCount = hyper.getFakeRequestCount();
var expectedCount = args[ 1 ];
var messagePlural = expectedCount == 1 ? "request" : "requests";
if ( args.len() >= 2 ) {
if ( structCount( args ) >= 2 ) {
expectation.message = args[ 2 ];
} else {
expectation.message = expectation.isNot ? "Expected not to have sent exactly #expectedCount# #messagePlural# but did." : "Expected to have sent exactly #expectedCount# #messagePlural# but sent #actualCount#.";
Expand All @@ -47,7 +47,7 @@ component {
function toHaveSentNothing( expectation, args = {} ) {
var hyper = expectation.actual;
var actualCount = hyper.getFakeRequestCount();
if ( args.len() >= 1 ) {
if ( structCount( args ) >= 1 ) {
expectation.message = args[ 1 ];
} else {
expectation.message = expectation.isNot ? "Expected to have sent any number of requests but have sent nothing." : "Expected to have sent no requests but have sent #actualCount#.";
Expand Down

0 comments on commit f17fa8c

Please sign in to comment.