Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubs #4

Closed
ebebbington opened this issue Jun 19, 2020 · 0 comments · Fixed by #18
Closed

Stubs #4

ebebbington opened this issue Jun 19, 2020 · 0 comments · Fixed by #18
Assignees

Comments

@ebebbington
Copy link
Member

ebebbington commented Jun 19, 2020

What

Develop the following method:

  • Rhum.Stub

Method should be public and should return a stubbed method (like the one passed in) that should be able to tell the user if it was called

Why
This is a testing framework dammit!

Checklist

  • Update README where needed

  • Unit tests

  • Maybe integration tests? Feel unit tests cover it fully

Resources

Use the following issue as a guideline if possible

Pseudo-code for Implementation

Stub: function (fn: Function): Function {
}

// Maybe used like so:
// Maybe something along the lines of:
let functionWasCalled = false;
function testFn() {
  functionWasCalled = true;
  return "Hello world!";
}
const copyTestFn = testFn;
Rhum.TestPlan("Testing TestCase", copyTestFn);
asserts.assertEquals(functionWasCalled, true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants