Skip to content

Commit

Permalink
feat: adds line of text before a test runs, to see what logs apply to…
Browse files Browse the repository at this point in the history
… and see where it crashed, if rooibios crashes before printing test output
  • Loading branch information
georgejecook committed Jan 24, 2020
1 parent 192dac5 commit a274dd7
Show file tree
Hide file tree
Showing 3 changed files with 1,227 additions and 1,178 deletions.
27 changes: 25 additions & 2 deletions outRun/.roku-deploy-staging/source/tests/ExpectTests.brs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,33 @@ function ET_expectOnce_valuesBug_reported(expectedValue, expectMockFail) as void
obj.foo(42)
m.isAutoAssertingMocks = false
m.AssertMocks()

isFail = m.currentResult.isFail
m.currentResult.Reset()
m.CleanMocks()
m.AssertEqual(isFail, expectMockFail)
m.AssertEqual(isFail, expectMockFail)
end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'@It tests mock count limit
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'@Test mock count limit at least 25
function ET_expect_mockCountLimitToBeAtLeast25() as void

interface = {}

mockCountLimit = 25
for i = 1 to mockCountLimit step + 1
keyName = StrI(i).trim()
interface[keyName] = function(arg0) : return arg0 : end function

expectedArg = "a"
expectedReturnValue = "b"
m.ExpectOnce(interface, keyName, [expectedArg], [expectedReturnValue])

interface[keyName](expectedArg)
end for

end function

Loading

0 comments on commit a274dd7

Please sign in to comment.