From 8367146f8f6a13e1183fb23aa6da92cc8253a14b Mon Sep 17 00:00:00 2001 From: George Cook Date: Tue, 4 Jun 2019 20:59:05 -0500 Subject: [PATCH] fix for box crash on asString when used on an aa with mock methods --- frameworkTests/source/tests/BasicTests.brs | 12 ++++++++++++ src/Rooibos_CommonUtils.brs | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/frameworkTests/source/tests/BasicTests.brs b/frameworkTests/source/tests/BasicTests.brs index cf6564de..f6aee906 100644 --- a/frameworkTests/source/tests/BasicTests.brs +++ b/frameworkTests/source/tests/BasicTests.brs @@ -28,6 +28,18 @@ function BT_EqualsFixForStubbedAAs() as void aa.getStubbedObject(aa) end function +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +'@It tests aa's that get printed as failures don't crash box +'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +'@Test +function BT_PrintResultsFixForStubbedAAs() as void + aa = {"test":"value"} + bb = {"other": value} + m.expectOnce(bb, "getStubbedObject", [aa]) + assertEqual(aa, bb) +end function + '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ '@It url in params '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/Rooibos_CommonUtils.brs b/src/Rooibos_CommonUtils.brs index ef481d0b..0f5ce968 100755 --- a/src/Rooibos_CommonUtils.brs +++ b/src/Rooibos_CommonUtils.brs @@ -306,7 +306,9 @@ function RBS_CMN_AsString(input ) as string isFirst = false end if for each key in input - text += key + ":" + RBS_CMN_AsString(input[key]) + if key <> "__mocks" and key <> "__stubs" + text += key + ":" + RBS_CMN_AsString(input[key]) + end if end for text += "}" return text