Skip to content

Commit

Permalink
Merge pull request #39 from georgejecook/bugfix/overloadedExpects_col…
Browse files Browse the repository at this point in the history
…lide_on_same_method_name_on_different_objects

Bugfix/overloaded expects collide on same method name on different objects
  • Loading branch information
georgejecook authored Mar 22, 2019
2 parents 9d0015c + 5e9721f commit 070a072
Show file tree
Hide file tree
Showing 16 changed files with 778 additions and 639 deletions.
283 changes: 150 additions & 133 deletions dist/rooibosDist.brs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Rooibos.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h1 class="page-title">Rooibos.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
377 changes: 197 additions & 180 deletions docs/Rooibos_BaseTestSuite.brs.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/Rooibos_CommonUtils.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ <h1 class="page-title">Rooibos_CommonUtils.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Rooibos_ItemGenerator.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h1 class="page-title">Rooibos_ItemGenerator.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/Rooibos_TestRunner.brs.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ <h1 class="page-title">Rooibos_TestRunner.brs</h1>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-BaseTestSuite.html
Original file line number Diff line number Diff line change
Expand Up @@ -12420,7 +12420,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-CommonUtils.html
Original file line number Diff line number Diff line change
Expand Up @@ -5062,7 +5062,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-ItemGenerator.html
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,7 @@ <h5>Returns:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-TestRunner.html
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ <h4 class="name" id="Run"><span class="type-signature"></span>Run<span class="si
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-rooibosh.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h5>Parameters:</h5>
<br class="clear">

<footer>
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 15:41:07 GMT-0500 (-05) using the Minami theme.
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Thu Mar 21 2019 20:05:44 GMT-0500 (-05) using the Minami theme.
</footer>

<script>prettyPrint();</script>
Expand Down
74 changes: 72 additions & 2 deletions frameworkTests/source/tests/AssertionTests.brs
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,11 @@ function Simp_expect_multiValues()

end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'@It tests expect with overloaded expectOnce
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'@Test can set up multi expects on same method
'@Test simple test
function Simp_expect_multiExpect_success()
obj = {}
arg1 = "arg1"
Expand Down Expand Up @@ -370,9 +373,9 @@ function Simp_expect_multiExpect_success()

m.currentResult.Reset()
m.AssertFalse(isFail)

end function


'@Test can set up multi expects on same method - one invocation with any args
function Simp_expect_multiExpect_success_oneCallsArgsNotTracked()
obj = {}
Expand Down Expand Up @@ -547,6 +550,73 @@ function Simp_expect_multiExpect_fail(call1, call2, call3)

m.currentResult.Reset()
m.AssertTrue(isFail)
end function

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'@It tests overloaded expectOnce on different objects
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'@Test success
function Simp_expect_multiExpect_differentOnj_success()
obj = {}
obj2 = {}
arg1 = "arg1"
arg2 = "arg2"
arg3 = "arg3"
result1 = 1
result2 = 2
result3 = 3

m.expectOnce(obj, "mockMethod", [arg1], result1, true)
m.expectOnce(obj, "mockMethod", [arg2], result2, true)
m.expectOnce(obj2, "mockMethod", [arg3], result3, true)

result = obj.mockMethod(arg1)
m.AssertEqual(result, result1)

result = obj.mockMethod(arg2)
m.AssertEqual(result, result2)

result = obj2.mockMethod(arg3)
m.AssertEqual(result, result3)

m.assertMocks()
isFail = m.currentResult.isFail

m.currentResult.Reset()
m.AssertFalse(isFail)

end function

'@Test fail to match
function Simp_expect_multiExpect_differentOnj_fail()
obj = {}
obj2 = {}
arg1 = "arg1"
arg2 = "arg2"
arg3 = "arg3"
result1 = 1
result2 = 2
result3 = 3

m.expectOnce(obj, "mockMethod", [arg1], result1, true)
m.expectOnce(obj, "mockMethod", [arg2], result2, true)
m.expectOnce(obj2, "mockMethod", [arg3], result3, true)

result = obj.mockMethod(arg1)
m.AssertEqual(result, result1)

result = obj.mockMethod(arg2)
m.AssertEqual(result, result2)

result = obj2.mockMethod(arg3)
m.AssertEqual(result, result3)

m.assertMocks()
isFail = m.currentResult.isFail

m.currentResult.Reset()
m.AssertFalse(isFail)

end function

Expand Down
5 changes: 3 additions & 2 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,6 @@ export function doc(cb) {
}

exports.build = series(clean, createDirectories, squash, copyToSamples);
exports.runFrameworkTests = series(exports.build, prepareFrameworkTests, copyToSamples, zipFrameworkTests, deployFrameworkTests)
exports.prePublishFrameworkTests = series(exports.build, prepareFrameworkTests, copyToSamples)
exports.runFrameworkTests = series(exports.build, prepareFrameworkTests, zipFrameworkTests, deployFrameworkTests)
exports.prePublishFrameworkTests = series(exports.build, prepareFrameworkTests)
exports.dist = series(exports.build, doc);
Loading

0 comments on commit 070a072

Please sign in to comment.