Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
It’s sometimes helpful to pretend that we know how certain functions work in order to get started. We can take this idea even further with mocks and stubs. Mocks and stubs are special kinds of "fake" helpers for our test suites; they fill in the gaps for our test unit’s dependencies.
Resources
Video review
- It’s sometimes helpful to pretend that you know how certain functions work in order to get started -- you can take this idea even further with mocks and stubs
- Using stubs lets you test logic that depends on important decisions about your code, without having to actually make them yet
- A test spec can use a "stub" version of a function to get all the values it needs for testing your logic, no matter how the real function is actually implemented
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up