Skip to content

Commit

Permalink
fix for box crash on asString when used on an aa with mock methods
Browse files Browse the repository at this point in the history
  • Loading branch information
George Cook committed Jun 5, 2019
1 parent dd47d74 commit 8367146
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
12 changes: 12 additions & 0 deletions frameworkTests/source/tests/BasicTests.brs
Original file line number Diff line number Diff line change
Expand Up @@ -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
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down
4 changes: 3 additions & 1 deletion src/Rooibos_CommonUtils.brs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8367146

Please sign in to comment.