Skip to content

Commit

Permalink
fix(stubs): do not update non-mockable objects, needlessly (#177)
Browse files Browse the repository at this point in the history
georgejecook authored Jun 8, 2022
1 parent e297fc9 commit 55b0f90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions framework/src/source/BaseTestSuite.bs
Original file line number Diff line number Diff line change
@@ -1619,7 +1619,7 @@ namespace rooibos

function _expectCalled(target, methodName, rootObject = invalid as dynamic, fullPath = invalid as dynamic, expectedArgs = invalid, returnValue = invalid as dynamic) as object
try
if fullPath <> invalid
if type(target) <> "roAssociativeArray" and fullPath <> invalid
target = rooibos.Common.makePathStubbable(rootObject, fullPath)
end if
return m.mock(target, methodName, 1, expectedArgs, returnValue, true)
@@ -1637,7 +1637,7 @@ namespace rooibos

function _stubCall(target, methodName, rootObject = invalid as dynamic, fullPath = invalid as dynamic, returnValue = invalid as dynamic) as object
try
if fullPath <> invalid
if type(target) <> "roAssociativeArray" and fullPath <> invalid
target = rooibos.Common.makePathStubbable(rootObject, fullPath)
end if
return m.stub(target, methodName, returnValue, true)
@@ -1656,7 +1656,7 @@ namespace rooibos

function _expectNotCalled(target, methodName, rootObject = invalid as dynamic, fullPath = invalid as dynamic) as object
try
if fullPath <> invalid
if type(target) <> "roAssociativeArray" and fullPath <> invalid
target = rooibos.Common.makePathStubbable(rootObject, fullPath)
end if
return m.mock(target, methodName, 0, invalid, invalid, true)

0 comments on commit 55b0f90

Please sign in to comment.