You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ProcessContextGitMock has an internal state from which it builds the ProcessResult.
Tests can add outputMessages to it that are accumulated.
The problem is that sub-sequent invocations with this approach lead to strange effects because the second invocation will additionally get output messages from the first invocation.
Therefore we should do the following:
When we create the ProcessResult we create a new List from outputMessages as a copy
At the end of the run method before we return the ProcessResult we do this.outputMessages.clear() to rest the state and avoid such ugly side-effects.
The text was updated successfully, but these errors were encountered:
ProcessContextGitMock has an internal state from which it builds the
ProcessResult
.Tests can add
outputMessages
to it that are accumulated.The problem is that sub-sequent invocations with this approach lead to strange effects because the second invocation will additionally get output messages from the first invocation.
Therefore we should do the following:
ProcessResult
we create a newList
fromoutputMessages
as a copyrun
method before we return theProcessResult
we dothis.outputMessages.clear()
to rest the state and avoid such ugly side-effects.The text was updated successfully, but these errors were encountered: